66 for (
int i = 0; funcs[i].
name; i++)
67 if (funcs[i].
op ==
op)
83static int print_macro(FILE *fp,
int maxwidth,
const char **macro)
89 mbstate_t mbstate1 = { 0 };
90 mbstate_t mbstate2 = { 0 };
92 for (; len && (k = mbrtowc(&wc, *macro, len, &mbstate1)); *macro += k, len -= k)
97 memset(&mbstate1, 0,
sizeof(mbstate1));
102 const int w = wcwidth(wc);
109 char buf[MB_LEN_MAX * 2];
118 else if ((wc < 0x20) || (wc == 0x7f))
132 fprintf(fp,
"^%c", (
char) ((wc +
'@') & 0x7f));
160 mbstate_t mbstate = { 0 };
162 for (m = wid, n = 0; len && (k = mbrtowc(&wc, s, len, &mbstate)) && (n <= wid);
170 memset(&mbstate, 0,
sizeof(mbstate));
194static int pad(FILE *fp,
int col,
int i)
198 char fmt[32] = { 0 };
199 snprintf(fmt,
sizeof(fmt),
"%%-%ds", i - col);
200 fprintf(fp, fmt,
"");
223static void format_line(FILE *fp,
int ismacro,
const char *t1,
const char *t2,
224 const char *t3,
int wraplen)
232 bool split = (wraplen < 40);
241 const int col_a = (wraplen > 83) ? (wraplen - 32) >> 2 : 12;
242 col_b = (wraplen > 49) ? (wraplen - 10) >> 1 : 19;
266 col =
pad(fp, col, col_b);
277 int n = wraplen - col;
301 col =
pad(fp, n, col_b);
317 struct Keymap *map = NULL;
318 char buf[128] = { 0 };
322 if (map->
op != OP_NULL)
326 if (map->
op == OP_MACRO)
338 _(
"ERROR: please report this bug"),
353 struct Keymap *map = NULL;
371 struct KeymapList *km_list,
struct KeymapList *aux,
int wraplen)
373 for (
int i = 0; funcs[i].
name; i++)
389 int index,
char *description)
392 if ((strlen(flag) < 1) || (*flag ==
' '))
397 format_line(fp, 0, flag,
"", description, wraplen);
411 format_line(fp, 0,
"$flag_chars:",
"",
"", wraplen);
414 _(
"message is flagged"));
417 _(
"attachment is deleted"));
419 _(
"message has been replied to"));
423 _(
"thread has been read"));
425 _(
"thread has at least one new message"));
427 _(
"message has been read (%S expando)"));
429 _(
"message has been read (%Z expando)"));
431 format_line(fp, 0,
"\n$crypt_chars:",
"",
"", wraplen);
433 _(
"message signed with a verified key"));
435 _(
"message is PGP-encrypted"));
437 _(
"message is signed"));
439 _(
"message contains a PGP key"));
441 _(
"message has no cryptography information"));
443 format_line(fp, 0,
"\n$to_chars:",
"",
"", wraplen);
445 _(
"message is not To: you"));
447 _(
"message is To: you and only you"));
451 _(
"message is From: you"));
453 _(
"message is sent to a subscribed mailing list"));
455 _(
"you are in the Reply-To: list"));
464 char banner[128] = { 0 };
474 desc =
_(
"<UNKNOWN>");
496 fprintf(fp,
"\n%s\n\n",
_(
"Generic bindings:"));
500 fprintf(fp,
"\n%s\n\n",
_(
"Unbound functions:"));
508 fprintf(fp,
"\n%s\n\n",
_(
"Message flags:"));
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
struct Buffer buf_make(size_t size)
Make a new buffer on the stack.
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.
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
const struct MenuFuncOp OpGeneric[]
Functions for the Generic Menu.
Convenience wrapper for the gui headers.
String processing routines to generate the mail index.
@ 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.
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.
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.
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.