71 for (
int i = 0; funcs[i].
name; i++)
72 if (funcs[i].
op ==
op)
88static int print_macro(FILE *fp,
int maxwidth,
const char **macro)
94 mbstate_t mbstate1 = { 0 };
95 mbstate_t mbstate2 = { 0 };
97 for (; len && (k = mbrtowc(&wc, *macro, len, &mbstate1)); *macro += k, len -= k)
102 memset(&mbstate1, 0,
sizeof(mbstate1));
107 const int w = wcwidth(wc);
114 char buf[MB_LEN_MAX * 2];
123 else if ((wc < 0x20) || (wc == 0x7f))
137 fprintf(fp,
"^%c", (
char) ((wc +
'@') & 0x7f));
165 mbstate_t mbstate = { 0 };
167 for (m = wid, n = 0; len && (k = mbrtowc(&wc, s, len, &mbstate)) && (n <= wid);
175 memset(&mbstate, 0,
sizeof(mbstate));
199static int pad(FILE *fp,
int col,
int i)
203 char fmt[32] = { 0 };
204 snprintf(fmt,
sizeof(fmt),
"%%-%ds", i - col);
205 fprintf(fp, fmt,
"");
228static void format_line(FILE *fp,
int ismacro,
const char *t1,
const char *t2,
229 const char *t3,
int wraplen)
237 bool split = (wraplen < 40);
246 const int col_a = (wraplen > 83) ? (wraplen - 32) >> 2 : 12;
247 col_b = (wraplen > 49) ? (wraplen - 10) >> 1 : 19;
271 col =
pad(fp, col, col_b);
282 int n = wraplen - col;
306 col =
pad(fp, n, col_b);
322 struct Keymap *map = NULL;
323 char buf[128] = { 0 };
327 if (map->
op != OP_NULL)
331 if (map->
op == OP_MACRO)
343 _(
"ERROR: please report this bug"),
358 struct Keymap *map = NULL;
376 struct KeymapList *km_list,
struct KeymapList *aux,
int wraplen)
378 for (
int i = 0; funcs[i].
name; i++)
394 int index,
char *description)
397 if ((strlen(flag) < 1) || (*flag ==
' '))
402 format_line(fp, 0, flag,
"", description, wraplen);
416 format_line(fp, 0,
"$flag_chars:",
"",
"", wraplen);
419 _(
"message is flagged"));
422 _(
"attachment is deleted"));
424 _(
"message has been replied to"));
428 _(
"thread has been read"));
430 _(
"thread has at least one new message"));
432 _(
"message has been read (%S expando)"));
434 _(
"message has been read (%Z expando)"));
436 format_line(fp, 0,
"\n$crypt_chars:",
"",
"", wraplen);
438 _(
"message signed with a verified key"));
440 _(
"message is PGP-encrypted"));
442 _(
"message is signed"));
444 _(
"message contains a PGP key"));
446 _(
"message has no cryptography information"));
448 format_line(fp, 0,
"\n$to_chars:",
"",
"", wraplen);
450 _(
"message is not To: you"));
452 _(
"message is To: you and only you"));
456 _(
"message is From: you"));
458 _(
"message is sent to a subscribed mailing list"));
460 _(
"you are in the Reply-To: list"));
469 char banner[128] = { 0 };
478 desc =
_(
"<UNKNOWN>");
500 fprintf(fp,
"\n%s\n\n",
_(
"Generic bindings:"));
504 fprintf(fp,
"\n%s\n\n",
_(
"Unbound functions:"));
512 fprintf(fp,
"\n%s\n\n",
_(
"Message flags:"));
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.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean 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.
struct MuttWindow * AllDialogsWindow
Parent of all Dialogs.
@ 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)
const struct MenuFuncOp OpGeneric[]
Functions for the Generic Menu.
Convenience wrapper for the gui headers.
static void dump_unbound(FILE *fp, const struct MenuFuncOp *funcs, struct KeymapList *km_list, struct KeymapList *aux, int wraplen)
Write out all the operations with no key bindings.
static int pad(FILE *fp, int col, int i)
Write some padding to a file.
static void show_flag_if_present(FILE *fp, int wraplen, const struct MbTable *table, int index, char *description)
Write out a message flag if exists.
static bool is_bound(struct KeymapList *km_list, int op)
Does a function have a keybinding?
static void dump_message_flags(FILE *fp, int wraplen)
Write out all the message flags.
static void format_line(FILE *fp, int ismacro, const char *t1, const char *t2, const char *t3, int wraplen)
Write a formatted line to a file.
static int get_wrapped_width(const char *t, size_t wid)
Wrap a string at a sensible place.
static int print_macro(FILE *fp, int maxwidth, const char **macro)
Print a macro string to a file.
static void dump_menu(FILE *fp, enum MenuType menu, int wraplen)
Write all the key bindings 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.
int km_expand_key(char *s, size_t len, struct Keymap *map)
Get the key string bound to a Keymap.
const struct MenuFuncOp * km_get_table(enum MenuType mtype)
Lookup a Menu's functions.
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.
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.
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.
struct WindowState state
Current state of the Window.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
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.