Parse and execute user-defined hooks. More...
Go to the source code of this file.
Macros | |
#define | MUTT_HOOK_NO_FLAGS 0 |
No flags are set. | |
#define | MUTT_FOLDER_HOOK (1 << 0) |
folder-hook: when entering a mailbox | |
#define | MUTT_MBOX_HOOK (1 << 1) |
mbox-hook: move messages after reading them | |
#define | MUTT_SEND_HOOK (1 << 2) |
send-hook: when composing a new email | |
#define | MUTT_FCC_HOOK (1 << 3) |
fcc-hook: to save outgoing email | |
#define | MUTT_SAVE_HOOK (1 << 4) |
save-hook: set a default folder when saving an email | |
#define | MUTT_CHARSET_HOOK (1 << 5) |
charset-hook: create a charset alias for malformed emails | |
#define | MUTT_ICONV_HOOK (1 << 6) |
iconv-hook: create a system charset alias | |
#define | MUTT_MESSAGE_HOOK (1 << 7) |
message-hook: run before displaying a message | |
#define | MUTT_CRYPT_HOOK (1 << 8) |
crypt-hook: automatically select a PGP/SMIME key | |
#define | MUTT_ACCOUNT_HOOK (1 << 9) |
account-hook: when changing between accounts | |
#define | MUTT_REPLY_HOOK (1 << 10) |
reply-hook: when replying to an email | |
#define | MUTT_SEND2_HOOK (1 << 11) |
send2-hook: when changing fields in the compose menu | |
#define | MUTT_OPEN_HOOK (1 << 12) |
open-hook: to read a compressed mailbox | |
#define | MUTT_APPEND_HOOK (1 << 13) |
append-hook: append to a compressed mailbox | |
#define | MUTT_CLOSE_HOOK (1 << 14) |
close-hook: write to a compressed mailbox | |
#define | MUTT_IDXFMTHOOK (1 << 15) |
index-format-hook: customise the format of the index | |
#define | MUTT_TIMEOUT_HOOK (1 << 16) |
timeout-hook: run a command periodically | |
#define | MUTT_STARTUP_HOOK (1 << 17) |
startup-hook: run when starting NeoMutt | |
#define | MUTT_SHUTDOWN_HOOK (1 << 18) |
shutdown-hook: run when leaving NeoMutt | |
#define | MUTT_GLOBAL_HOOK (1 << 19) |
Hooks which don't take a regex. | |
Typedefs | |
typedef uint32_t | HookFlags |
Flags for mutt_parse_hook(), e.g. MUTT_FOLDER_HOOK. | |
Functions | |
void | hooks_init (void) |
Setup feature commands. | |
enum CommandResult | mutt_parse_hook (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
Parse the 'hook' family of commands - Implements Command::parse() -. | |
void | mutt_account_hook (const char *url) |
Perform an account hook. | |
void | mutt_crypt_hook (struct ListHead *list, struct Address *addr) |
Find crypto hooks for an Address. | |
void | mutt_default_save (struct Buffer *path, struct Email *e) |
Find the default save path for an email. | |
void | mutt_delete_hooks (HookFlags type) |
Delete matching hooks. | |
char * | mutt_find_hook (HookFlags type, const char *pat) |
Find a matching hook. | |
void | mutt_folder_hook (const char *path, const char *desc) |
Perform a folder hook. | |
const struct Expando * | mutt_idxfmt_hook (const char *name, struct Mailbox *m, struct Email *e) |
Get index-format-hook format string. | |
void | mutt_message_hook (struct Mailbox *m, struct Email *e, HookFlags type) |
Perform a message hook. | |
enum CommandResult | mutt_parse_charset_iconv_hook (struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err) |
Parse 'charset-hook' and 'iconv-hook' commands - Implements Command::parse() -. | |
void | mutt_select_fcc (struct Buffer *path, struct Email *e) |
Select the FCC path for an email. | |
void | mutt_startup_shutdown_hook (HookFlags type) |
Execute any startup/shutdown hooks. | |
void | mutt_timeout_hook (void) |
Execute any timeout hooks. | |
Parse and execute user-defined hooks.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file hook.h.
#define MUTT_FOLDER_HOOK (1 << 0) |
#define MUTT_MBOX_HOOK (1 << 1) |
#define MUTT_SEND_HOOK (1 << 2) |
#define MUTT_FCC_HOOK (1 << 3) |
#define MUTT_SAVE_HOOK (1 << 4) |
#define MUTT_CHARSET_HOOK (1 << 5) |
#define MUTT_ICONV_HOOK (1 << 6) |
#define MUTT_MESSAGE_HOOK (1 << 7) |
#define MUTT_CRYPT_HOOK (1 << 8) |
#define MUTT_ACCOUNT_HOOK (1 << 9) |
#define MUTT_REPLY_HOOK (1 << 10) |
#define MUTT_SEND2_HOOK (1 << 11) |
#define MUTT_OPEN_HOOK (1 << 12) |
#define MUTT_APPEND_HOOK (1 << 13) |
#define MUTT_CLOSE_HOOK (1 << 14) |
#define MUTT_IDXFMTHOOK (1 << 15) |
#define MUTT_TIMEOUT_HOOK (1 << 16) |
#define MUTT_STARTUP_HOOK (1 << 17) |
#define MUTT_SHUTDOWN_HOOK (1 << 18) |
#define MUTT_GLOBAL_HOOK (1 << 19) |
typedef uint32_t HookFlags |
Flags for mutt_parse_hook(), e.g. MUTT_FOLDER_HOOK.
void hooks_init | ( | void | ) |
Setup feature commands.
Definition at line 1051 of file hook.c.
void mutt_account_hook | ( | const char * | url | ) |
Perform an account hook.
url | Account URL to match |
Definition at line 887 of file hook.c.
void mutt_crypt_hook | ( | struct ListHead * | list, |
struct Address * | addr | ||
) |
Find crypto hooks for an Address.
[out] | list | List of keys |
[in] | addr | Address to match |
The crypt-hook associates keys with addresses.
Definition at line 878 of file hook.c.
Find the default save path for an email.
Definition at line 778 of file hook.c.
void mutt_delete_hooks | ( | HookFlags | type | ) |
char * mutt_find_hook | ( | HookFlags | type, |
const char * | pat | ||
) |
void mutt_folder_hook | ( | const char * | path, |
const char * | desc | ||
) |
Perform a folder hook.
path | Path to potentially match |
desc | Description to potentially match |
Definition at line 631 of file hook.c.
Get index-format-hook format string.
ptr | Expando |
NULL | No matching hook |
Definition at line 991 of file hook.c.
Perform a message hook.
Definition at line 700 of file hook.c.
Select the FCC path for an email.
Definition at line 816 of file hook.c.
void mutt_startup_shutdown_hook | ( | HookFlags | type | ) |
Execute any startup/shutdown hooks.
type | Hook type: MUTT_STARTUP_HOOK or MUTT_SHUTDOWN_HOOK |
The user can configure hooks to be run on startup/shutdown. This function finds all the matching hooks and executes them.
Definition at line 964 of file hook.c.
void mutt_timeout_hook | ( | void | ) |
Execute any timeout hooks.
The user can configure hooks to be run on timeout. This function finds all the matching hooks and executes them.
Definition at line 932 of file hook.c.