82 for (
int i = 0; funcs[i].
name; i++)
83 if (funcs[i].
op ==
op)
113 mbstate_t mbstate1 = { 0 };
114 mbstate_t mbstate2 = { 0 };
116 for (; (len > 0) && (k = mbrtowc(&wc, macro, MB_LEN_MAX, &mbstate1)); macro += k, len -= k)
121 memset(&mbstate1, 0,
sizeof(mbstate1));
126 const int w = wcwidth(wc);
129 char tmp[MB_LEN_MAX * 2] = { 0 };
135 else if ((wc < 0x20) || (wc == 0x7f))
165 struct HelpLineArray *hla_macro)
167 struct Keymap *map = NULL;
172 if (map->
op == OP_NULL)
182 if (map->
op == OP_MACRO)
243 fprintf(fp,
_(
"%s bindings:"), desc);
248 fprintf(fp,
"%*s ", -w1, hl->
first);
249 fprintf(fp,
"%*s %s\n", -w2, hl->
second, hl->
third);
254 fprintf(fp,
"\n%s\n\n",
_(
"Generic bindings:"));
257 fprintf(fp,
"%*s ", -w1, hl->
first);
258 fprintf(fp,
"%*s %s\n", -w2, hl->
second, hl->
third);
264 fprintf(fp,
"\n%s\n\n",
_(
"macros:"));
268 fprintf(fp,
"%*s ", -w1, hl->
first);
276 fprintf(fp,
"%s\n", hl->
third);
313static bool is_bound(
struct KeymapList *km_list,
int op)
315 struct Keymap *map = NULL;
334 struct KeymapList *aux,
struct HelpLineArray *hla)
336 for (
int i = 0; funcs[i].
name; i++)
357 fprintf(fp,
"\n%s\n\n",
_(
"Unbound functions:"));
378 fprintf(fp,
"%*s %s\n", -w1, hl->
first, hl->
second);
394 if ((strlen(flag) < 1) || (*flag ==
' '))
399 fprintf(fp,
" %s%*s %s\n", flag, 4 - cols,
"", desc);
417 fprintf(fp,
"\n%s\n\n",
_(
"Message flags:"));
423 fputs(
"$flag_chars:\n", fp);
433 _(
"thread has at least one new message"));
435 _(
"message has been read (%S expando)"));
437 _(
"message has been read (%Z expando)"));
439 fputs(
"\n$crypt_chars:\n", fp);
441 _(
"message signed with a verified key"));
443 _(
"message is PGP-encrypted"));
446 _(
"message contains a PGP key"));
448 _(
"message has no cryptography information"));
450 fputs(
"\n$to_chars:\n", fp);
452 _(
"message is not To: you"));
454 _(
"message is To: you and only you"));
459 _(
"message is sent to a subscribed mailing list"));
461 _(
"you are in the Reply-To: list"));
471 char banner[128] = { 0 };
#define ARRAY_SORT(head, fn, sdata)
Sort an array.
#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_EMPTY(head)
Check if an array is empty.
#define ARRAY_HEAD(name, type)
Define a named struct for arrays of elements of a certain type.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
int buf_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to 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".
struct MbTable * cs_subset_mbtable(const struct ConfigSubset *sub, const char *name)
Get a Multibyte table config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
@ FLAG_CHAR_TO_ORIGINATOR
Character denoting that the user is originator.
@ FLAG_CHAR_TO_UNIQUE
Character denoting that the user is unique recipient.
@ FLAG_CHAR_TO_NOT_IN_THE_LIST
Character denoting that the user is not in list.
@ FLAG_CHAR_TO_TO
Character denoting that the user is in the TO list.
@ FLAG_CHAR_TO_CC
Character denoting that the user is in the CC list.
@ FLAG_CHAR_TO_REPLY_TO
Character denoting that the user is in the Reply-To list.
@ FLAG_CHAR_TO_SUBSCRIBED_LIST
Character denoting that the message is sent to a subscribed mailing list.
@ FLAG_CHAR_CRYPT_CONTAINS_KEY
Character denoting a message contains a PGP key.
@ FLAG_CHAR_CRYPT_SIGNED
Character denoting a message is signed.
@ FLAG_CHAR_CRYPT_NO_CRYPTO
Character denoting a message has no cryptography information.
@ FLAG_CHAR_CRYPT_GOOD_SIGN
Character denoting a message signed with a verified key.
@ FLAG_CHAR_CRYPT_ENCRYPTED
Character denoting a message is PGP-encrypted.
@ FLAG_CHAR_OLD
Character denoting an email that has been read.
@ FLAG_CHAR_REPLIED
Character denoting an email that has been replied to.
@ FLAG_CHAR_OLD_THREAD
Character denoting a thread of emails that has been read.
@ FLAG_CHAR_ZEMPTY
Character denoting a read email, $index_format Z expando.
@ FLAG_CHAR_TAGGED
Character denoting a tagged email.
@ FLAG_CHAR_NEW
Character denoting an unread email.
@ FLAG_CHAR_DELETED
Character denoting a deleted email.
@ FLAG_CHAR_NEW_THREAD
Character denoting a thread containing at least one new email.
@ FLAG_CHAR_DELETED_ATTACH
Character denoting a deleted attachment.
@ FLAG_CHAR_SEMPTY
Character denoting a read email, $index_format S expando.
@ FLAG_CHAR_IMPORTANT
Character denoting a important (flagged) email.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
static int help_sort_alpha(const void *a, const void *b, void *sdata)
Compare two Help Lines by their first entry - Implements sort_t -.
const struct MenuFuncOp OpGeneric[]
Functions for the Generic Menu.
Convenience wrapper for the gui headers.
static void dump_message_flags(enum MenuType menu, FILE *fp)
Write out all the message flags.
static bool is_bound(struct KeymapList *km_list, int op)
Does a function have a keybinding?
static void dump_unbound(enum MenuType menu, FILE *fp)
Dump the unbound keys to a file.
static void dump_unbound_menu(const struct MenuFuncOp *funcs, struct KeymapList *km_list, struct KeymapList *aux, struct HelpLineArray *hla)
Write the operations with no key bindings to a HelpLine Array.
static void dump_menu(enum MenuType menu, struct HelpLineArray *hla_menu, struct HelpLineArray *hla_macro)
Write all the key bindings to a HelpLine Array.
static void escape_macro(const char *macro, struct Buffer *buf)
Escape any special characters in a macro.
static void show_flag_if_present(FILE *fp, const struct MbTable *table, int index, char *desc)
Write out a message flag if exists.
static void dump_bound(enum MenuType menu, FILE *fp)
Dump the bound keys to a file.
static const struct MenuFuncOp * help_lookup_function(int op, enum MenuType menu)
Find a keybinding for an operation.
void mutt_help(enum MenuType menu)
Display the help menu.
GUI manage the main index (list of emails)
struct KeymapList Keymaps[MENU_MAX]
Array of key mappings, one for each MenuType.
const struct MenuFuncOp * km_get_table(enum MenuType mtype)
Lookup a Menu's functions.
bool km_expand_key(struct Keymap *map, struct Buffer *buf)
Get the key string bound to a Keymap.
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
const char * mbtable_get_nth_wchar(const struct MbTable *table, int index)
Extract one char from a multi-byte table.
wchar_t ReplacementChar
When a Unicode character can't be displayed, use this instead.
#define ICONV_BUF_TOO_SMALL
Error value for iconv() - Buffer too small.
#define ICONV_ILLEGAL_SEQ
Error value for iconv() - Illegal sequence.
Convenience wrapper for the library headers.
int mutt_str_cmp(const char *a, const char *b)
Compare two strings, safely.
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
const char * opcodes_get_description(int op)
Get the description of an opcode.
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.
Prototypes for many functions.
#define STAILQ_FOREACH(var, head, field)
String manipulation buffer.
const char * second
Second column.
const char * third
Third column.
const char * first
First column.
char * macro
Macro expansion (op == OP_MACRO)
char * desc
Description of a macro for the help menu.
short op
Operation to perform.
Multibyte character table.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
const struct Mapping MenuNames[]
Menu name lookup table.
MenuType
Types of GUI selections.
@ MENU_INDEX
Index panel (list of emails)
@ MENU_GENERIC
Generic selection list.
@ MENU_PAGER
Pager pager (email viewer)
@ MENU_EDITOR
Text entry area.