58 if (map->
op == OP_MACRO)
61 char key_binding[128] = { 0 };
62 const char *fn_name = NULL;
65 if (map->
op == OP_NULL)
123 struct Keymap *map = NULL;
127 if (map->
op != OP_MACRO)
130 char key_binding[128] = { 0 };
138 buf_add_printf(buf,
"macro %s %s \"%s\" \"%s\"\n", name, key_binding,
176 bool dump_all =
false, bind = (
data == 0);
201 if (menu_index == -1)
219 buf_printf(err, bind ?
_(
"%s: no binds for this menu") :
_(
"%s: no macros for this menu"),
246 pview.
banner = (bind) ?
"bind" :
"macro";
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
int buf_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
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.
size_t escape_string(struct Buffer *buf, const char *src)
Write a string to a buffer, escaping special characters.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
enum CommandResult dump_bind_macro(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse 'bind' and 'macro' commands - Implements Command::parse() -.
const struct MenuFuncOp OpGeneric[]
Functions for the Generic Menu.
Convenience wrapper for the gui headers.
static void dump_all_macros(struct Buffer *buf)
Dumps all the macros inside every menu.
static void dump_all_binds(struct Buffer *buf)
Dumps all the binds inside every menu.
static bool dump_bind(struct Buffer *buf, enum MenuType menu, const char *name)
Dumps all the binds maps of a menu into a buffer.
static bool dump_macro(struct Buffer *buf, enum MenuType menu, const char *name)
Dumps all the macros maps of a menu into a buffer.
struct KeymapList Keymaps[MENU_MAX]
Array of key mappings, one for each MenuType.
int km_expand_key(char *s, size_t len, struct Keymap *map)
Get the key string bound to a Keymap.
const char * mutt_get_func(const struct MenuFuncOp *funcs, int op)
Get the name of a function.
const struct MenuFuncOp * km_get_table(enum MenuType mtype)
Lookup a Menu's functions.
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Convenience wrapper for the library headers.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
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_FOREACH(var, head, field)
String manipulation buffer.
char * data
Pointer to data.
char * macro
Macro expansion (op == OP_MACRO)
char * desc
Description of a macro for the help menu.
short op
Operation to perform.
const struct Mapping MenuNames[]
Menu name lookup table.
MenuType
Types of GUI selections.
@ MENU_GENERIC
Generic selection list.
@ MENU_PAGER
Pager pager (email viewer)
@ MENU_EDITOR
Text entry area.