54 struct MenuDefinitionArray
mda;
124 char *p = token->
data;
148 if (
buf_at(token, 0) ==
'\0')
178 char *marker = menu_names_dup;
179 char *menu_name = NULL;
195 FREE(&menu_names_dup);
262 struct Buffer *keystr = NULL;
289 km_bind(md, key, OP_NULL, NULL, NULL, NULL);
326 rc =
km_bind(md, key,
op, NULL, NULL, err);
353 bool success =
false;
367 km_bind(
MdIndex,
"<enter>", OP_DISPLAY_MESSAGE, NULL, NULL, NULL);
368 km_bind(
MdIndex,
"<return>", OP_DISPLAY_MESSAGE, NULL, NULL, NULL);
375 km_bind(
MdEditor,
"<backspace>", OP_EDITOR_BACKSPACE, NULL, NULL, NULL);
414 return "NT_BINDING_ADD";
416 return "NT_BINDING_DELETE";
418 return "NT_MACRO_ADD";
420 return "NT_MACRO_DELETE";
452 if (!cmd || !line || !err || !args)
539 if (!cmd || !args || !err)
551 bool success =
false;
565 if ((*mdp2)->id == md->
id)
582 struct Keymap *km_tmp = NULL;
586 ((key_len == km->
len) && (memcmp(km->
keys, key_bytes, km->
len) == 0)))
693 struct Buffer *keystr = NULL;
702 if (
buf_at(token, 0) ==
'\0')
725 rc =
km_bind(md, key, OP_MACRO, seq, token->
data, NULL);
749 rc =
km_bind(md, key, OP_MACRO, token->
data, NULL, NULL);
794 char *function = NULL;
799 function = token->
data;
803 if (ops[nops] == OP_NULL)
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_GET(head, idx)
Return the element at index.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
char buf_at(const struct Buffer *buf, size_t offset)
Return the character at the given offset.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
CommandResult
Error codes for command_t parse functions.
@ MUTT_CMD_SUCCESS
Success: Command worked.
@ MUTT_CMD_ERROR
Error: Can't help the user.
@ MUTT_CMD_WARNING
Warning: Help given to the user.
Convenience wrapper for the config headers.
bool StartupComplete
When the config has been read.
Convenience wrapper for the core headers.
struct MenuDefinition * MdEditor
Editor Menu Definition.
void generic_tokenize_push_string(char *s)
Parse and queue a 'push' command.
void mutt_flushinp(void)
Empty all the keyboard buffers.
void mutt_push_macro_event(int ch, int op)
Add the character/operation to the macro buffer.
enum CommandResult parse_bind(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'bind' command - Implements Command::parse() -.
enum CommandResult parse_exec(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'exec' command - Implements Command::parse() -.
enum CommandResult parse_macro(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'macro' command - Implements Command::parse() -.
enum CommandResult parse_push(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'push' command - Implements Command::parse() -.
enum CommandResult parse_dump(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse 'bind' and 'macro' commands - Implements Command::parse() -.
enum CommandResult parse_unbind(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'unbind' and 'unmacro' commands - Implements Command::parse() -.
#define mutt_debug(LEVEL,...)
struct MenuDefinition * MdDialog
Dialog Menu Definition.
struct MenuDefinition * MdGeneric
Generic Menu Definition.
Convenience wrapper for the gui headers.
struct MenuDefinition * MdIndex
Index Menu Definition.
GUI manage the main index (list of emails)
struct MenuDefinitionArray MenuDefs
All the registered Menus.
const char * notify_binding_name(enum NotifyBinding ev)
Get the name for a NotifyBinding.
void set_default_bindings(const struct MenuDefinition *md)
Set some safe default keybindings.
bool parse_unbind_exec(const struct Command *cmd, struct ParseUnbind *args, struct Buffer *err)
Execute the 'unbind' or 'unmacro' command.
char * parse_keymap(const struct Command *cmd, struct MenuDefinitionArray *mda, struct Buffer *line, struct Buffer *err)
Parse a user-config key binding.
bool parse_unbind_args(const struct Command *cmd, struct Buffer *line, struct Buffer *err, struct ParseUnbind *args)
Parse the 'unbind' and 'unmacro' commands.
void parse_menu(struct MenuDefinitionArray *menus, const char *s, struct Buffer *err)
Parse menu-names into an array.
Parse key binding commands.
enum CommandResult km_bind(struct MenuDefinition *md, const char *key_str, int op, char *macro, char *desc, struct Buffer *err)
Set up a key binding.
void dump_bind_macro(const struct Command *cmd, const struct MenuDefinition *md, struct Buffer *buf, struct Buffer *err)
Dump a Menu's binds or macros to the Pager.
void keymap_expand_string(const char *str, struct Buffer *buf)
Get a human-readable key string.
void keymap_free(struct Keymap **pptr)
Free a Keymap.
size_t parse_keys(const char *str, keycode_t *d, size_t max)
Parse a key string into key codes.
Key binding notifications.
NotifyBinding
Key Binding notification types.
@ NT_MACRO_ADD
Key macro has been added.
@ NT_MACRO_DELETE
Key macro has been deleted.
@ NT_BINDING_DELETE
Key binding has been deleted.
@ NT_BINDING_ADD
Key binding has been added.
short keycode_t
Type for key storage, the rest of neomutt works fine with int type.
@ LL_NOTIFY
Log of notifications.
#define FREE(x)
Free memory and set the pointer to NULL.
Convenience wrapper for the library headers.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
char * mutt_str_sep(char **stringp, const char *delim)
Find first occurrence of any of delim characters in *stringp.
@ NT_BINDING
Key binding has changed, NotifyBinding, EventBinding.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
#define STAILQ_REMOVE(head, elm, type, field)
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
String manipulation buffer.
char * dptr
Current read/write position.
char * data
Pointer to data.
const char * name
Name of the Command.
enum CommandId id
ID of the Command.
const char * key
Key string being bound (for new bind/macro)
int op
Operation the key's bound to (for bind), e.g. OP_DELETE.
keycode_t * keys
Key sequence.
short len
Length of key sequence (unit: sizeof (keycode_t))
Container for Accounts, Notifications.
struct Notify * notify
Notifications handler.
Context for config parsing (history/backtrace)
Detailed error information from config parsing.
struct Buffer * message
Error message.
Parsed 'unbind' or 'unmacro' command.
bool all_menus
Command affects all Menus.
struct MenuDefinitionArray mda
Menus to work on.
const char * key
Key string to be removed.
bool all_keys
Command affects all key bindings.
MenuType
Types of GUI selections.