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. More... | |
#define | MUTT_FOLDER_HOOK (1 << 0) |
folder-hook: when entering a mailbox More... | |
#define | MUTT_MBOX_HOOK (1 << 1) |
mbox-hook: move messages after reading them More... | |
#define | MUTT_SEND_HOOK (1 << 2) |
send-hook: when composing a new email More... | |
#define | MUTT_FCC_HOOK (1 << 3) |
fcc-hook: to save outgoing email More... | |
#define | MUTT_SAVE_HOOK (1 << 4) |
save-hook: set a default folder when saving an email More... | |
#define | MUTT_CHARSET_HOOK (1 << 5) |
charset-hook: create a charset alias for malformed emails More... | |
#define | MUTT_ICONV_HOOK (1 << 6) |
iconv-hook: create a system charset alias More... | |
#define | MUTT_MESSAGE_HOOK (1 << 7) |
message-hook: run before displaying a message More... | |
#define | MUTT_CRYPT_HOOK (1 << 8) |
crypt-hook: automatically select a PGP/SMIME key More... | |
#define | MUTT_ACCOUNT_HOOK (1 << 9) |
account-hook: when changing between accounts More... | |
#define | MUTT_REPLY_HOOK (1 << 10) |
reply-hook: when replying to an email More... | |
#define | MUTT_SEND2_HOOK (1 << 11) |
send2-hook: when changing fields in the compose menu More... | |
#define | MUTT_OPEN_HOOK (1 << 12) |
open-hook: to read a compressed mailbox More... | |
#define | MUTT_APPEND_HOOK (1 << 13) |
append-hook: append to a compressed mailbox More... | |
#define | MUTT_CLOSE_HOOK (1 << 14) |
close-hook: write to a compressed mailbox More... | |
#define | MUTT_IDXFMTHOOK (1 << 15) |
index-format-hook: customise the format of the index More... | |
#define | MUTT_TIMEOUT_HOOK (1 << 16) |
timeout-hook: run a command periodically More... | |
#define | MUTT_STARTUP_HOOK (1 << 17) |
startup-hook: run when starting NeoMutt More... | |
#define | MUTT_SHUTDOWN_HOOK (1 << 18) |
shutdown-hook: run when leaving NeoMutt More... | |
#define | MUTT_GLOBAL_HOOK (1 << 19) |
Hooks which don't take a regex. More... | |
Typedefs | |
typedef uint32_t | HookFlags |
Flags for mutt_parse_hook(), e.g. MUTT_FOLDER_HOOK. More... | |
Functions | |
void | hooks_init (void) |
Setup feature commands. More... | |
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() -. More... | |
void | mutt_account_hook (const char *url) |
Perform an account hook. More... | |
void | mutt_crypt_hook (struct ListHead *list, struct Address *addr) |
Find crypto hooks for an Address. More... | |
void | mutt_default_save (char *path, size_t pathlen, struct Email *e) |
Find the default save path for an email. More... | |
void | mutt_delete_hooks (HookFlags type) |
Delete matching hooks. More... | |
char * | mutt_find_hook (HookFlags type, const char *pat) |
Find a matching hook. More... | |
void | mutt_folder_hook (const char *path, const char *desc) |
Perform a folder hook. More... | |
const char * | mutt_idxfmt_hook (const char *name, struct Mailbox *m, struct Email *e) |
Get index-format-hook format string. More... | |
void | mutt_message_hook (struct Mailbox *m, struct Email *e, HookFlags type) |
Perform a message hook. More... | |
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() -. More... | |
void | mutt_select_fcc (struct Buffer *path, struct Email *e) |
Select the FCC path for an email. More... | |
void | mutt_startup_shutdown_hook (HookFlags type) |
Execute any startup/shutdown hooks. More... | |
void | mutt_timeout_hook (void) |
Execute any timeout hooks. More... | |
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 1018 of file hook.c.
void mutt_account_hook | ( | const char * | url | ) |
Perform an account hook.
url | Account URL to match |
Definition at line 847 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 838 of file hook.c.
void mutt_default_save | ( | char * | path, |
size_t | pathlen, | ||
struct Email * | e | ||
) |
Find the default save path for an email.
Definition at line 737 of file hook.c.
void mutt_delete_hooks | ( | HookFlags | type | ) |
Delete matching hooks.
If MUTT_HOOK_NO_FLAGS is passed, all the hooks will be deleted.
Definition at line 367 of file hook.c.
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 589 of file hook.c.
Get index-format-hook format string.
ptr | printf(3)-like format string |
NULL | No matching hook |
Definition at line 958 of file hook.c.
Perform a message hook.
Definition at line 658 of file hook.c.
Select the FCC path for an email.
Definition at line 776 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 928 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 892 of file hook.c.