NeoMutt  2025-09-05-7-geaa2bd
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
mutt_config.c
Go to the documentation of this file.
1
35#include "config.h"
36#include <stdbool.h>
37#include <stddef.h>
38#include <stdint.h>
39#include <stdio.h>
40#include "mutt/lib.h"
41#include "config/lib.h"
42#include "email/lib.h"
43#include "core/lib.h"
44#include "attach/lib.h"
45#include "expando/lib.h"
46#include "index/lib.h"
47#include "mutt_logging.h"
48#include "mutt_thread.h"
49#include "mx.h"
50
51extern const struct ExpandoDefinition IndexFormatDef[];
52
53#define CONFIG_INIT_TYPE(CS, NAME) \
54 extern const struct ConfigSetType Cst##NAME; \
55 cs_register_type(CS, &Cst##NAME)
56
57#define CONFIG_INIT_VARS(CS, NAME) \
58 bool config_init_##NAME(struct ConfigSet *cs); \
59 config_init_##NAME(CS)
60
64static const struct Mapping SortAuxMethods[] = {
65 // clang-format off
66 { "date", EMAIL_SORT_DATE },
67 { "date-received", EMAIL_SORT_DATE_RECEIVED },
68 { "from", EMAIL_SORT_FROM },
69 { "label", EMAIL_SORT_LABEL },
70 { "score", EMAIL_SORT_SCORE },
71 { "size", EMAIL_SORT_SIZE },
72 { "spam", EMAIL_SORT_SPAM },
73 { "subject", EMAIL_SORT_SUBJECT },
74 { "to", EMAIL_SORT_TO },
75 { "unsorted", EMAIL_SORT_UNSORTED },
76 // Compatibility
77 { "date-sent", EMAIL_SORT_DATE },
78 { "mailbox-order", EMAIL_SORT_UNSORTED },
79 { "threads", EMAIL_SORT_DATE },
80 { NULL, 0 },
81 // clang-format on
82};
83
87const struct Mapping SortMethods[] = {
88 // clang-format off
89 { "date", EMAIL_SORT_DATE },
90 { "date-received", EMAIL_SORT_DATE_RECEIVED },
91 { "from", EMAIL_SORT_FROM },
92 { "label", EMAIL_SORT_LABEL },
93 { "score", EMAIL_SORT_SCORE },
94 { "size", EMAIL_SORT_SIZE },
95 { "spam", EMAIL_SORT_SPAM },
96 { "subject", EMAIL_SORT_SUBJECT },
97 { "threads", EMAIL_SORT_THREADS },
98 { "to", EMAIL_SORT_TO },
99 { "unsorted", EMAIL_SORT_UNSORTED },
100 // Compatibility
101 { "date-sent", EMAIL_SORT_DATE },
102 { "mailbox-order", EMAIL_SORT_UNSORTED },
103 { NULL, 0 },
104 // clang-format on
105};
106
110static int multipart_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
111{
112 if (value == 0)
113 return CSR_SUCCESS;
114
115 const char *str = (const char *) value;
116
117 if (mutt_str_equal(str, "inline") || mutt_str_equal(str, "info"))
118 return CSR_SUCCESS;
119
120 buf_printf(err, _("Invalid value for option %s: %s"), cdef->name, str);
121 return CSR_ERR_INVALID;
122}
123
130static const struct ExpandoDefinition AttachFormatDef[] = {
131 // clang-format off
132 { "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
133 { ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
134 { "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
135 { "c", "charset-convert", ED_BODY, ED_BOD_CHARSET_CONVERT, NULL },
136 { "C", "charset", ED_ATTACH, ED_ATT_CHARSET, NULL },
137 { "d", "description", ED_BODY, ED_BOD_DESCRIPTION, NULL },
138 { "D", "deleted", ED_BODY, ED_BOD_DELETED, NULL },
139 { "e", "mime-encoding", ED_BODY, ED_BOD_MIME_ENCODING, NULL },
140 { "f", "file", ED_BODY, ED_BOD_FILE, NULL },
141 { "F", "file-disposition", ED_BODY, ED_BOD_FILE_DISPOSITION, NULL },
142 { "I", "disposition", ED_BODY, ED_BOD_DISPOSITION, NULL },
143 { "m", "mime-major", ED_BODY, ED_BOD_MIME_MAJOR, NULL },
144 { "M", "mime-minor", ED_BODY, ED_BOD_MIME_MINOR, NULL },
145 { "n", "number", ED_ATTACH, ED_ATT_NUMBER, NULL },
146 { "Q", "attach-qualifies", ED_BODY, ED_BOD_ATTACH_QUALIFIES, NULL },
147 { "s", "file-size", ED_BODY, ED_BOD_FILE_SIZE, NULL },
148 { "t", "tagged", ED_BODY, ED_BOD_TAGGED, NULL },
149 { "T", "tree", ED_ATTACH, ED_ATT_TREE, NULL },
150 { "u", "unlink", ED_BODY, ED_BOD_UNLINK, NULL },
151 { "X", "attach-count", ED_BODY, ED_BOD_ATTACH_COUNT, NULL },
152 { NULL, NULL, 0, -1, NULL }
153 // clang-format on
154};
155
163 struct ExpandoFormat *fmt, int did,
164 int uid, ExpandoParserFlags flags,
165 const char **parsed_until,
166 struct ExpandoParseError *err)
167{
168 if (flags & EP_CONDITIONAL)
169 {
170 return node_conddate_parse(str, did, uid, parsed_until, err);
171 }
172
173 return node_expando_parse_enclosure(str, did, uid, ')', fmt, parsed_until, err);
174}
175
182struct ExpandoNode *parse_index_date_local(const char *str, struct ExpandoFormat *fmt,
183 int did, int uid, ExpandoParserFlags flags,
184 const char **parsed_until,
185 struct ExpandoParseError *err)
186{
187 if (flags & EP_CONDITIONAL)
188 {
189 return node_conddate_parse(str, did, uid, parsed_until, err);
190 }
191
192 return node_expando_parse_enclosure(str, did, uid, ']', fmt, parsed_until, err);
193}
194
201struct ExpandoNode *parse_index_date(const char *str, struct ExpandoFormat *fmt,
202 int did, int uid, ExpandoParserFlags flags,
203 const char **parsed_until,
204 struct ExpandoParseError *err)
205{
206 if (flags & EP_CONDITIONAL)
207 {
208 return node_conddate_parse(str, did, uid, parsed_until, err);
209 }
210
211 return node_expando_parse_enclosure(str, did, uid, '}', fmt, parsed_until, err);
212}
213
221struct ExpandoNode *parse_index_hook(const char *str, struct ExpandoFormat *fmt,
222 int did, int uid, ExpandoParserFlags flags,
223 const char **parsed_until,
224 struct ExpandoParseError *err)
225{
226 if (flags & EP_CONDITIONAL)
227 {
228 snprintf(err->message, sizeof(err->message),
229 _("index-hook cannot be used as a condition"));
230 err->position = str;
231 return NULL;
232 }
233
234 return node_expando_parse_enclosure(str, did, uid, '@', fmt, parsed_until, err);
235}
236
242struct ExpandoNode *parse_tags_transformed(const char *str, struct ExpandoFormat *fmt,
243 int did, int uid, ExpandoParserFlags flags,
244 const char **parsed_until,
245 struct ExpandoParseError *err)
246{
247 // Tag expando %G must use an suffix from [A-Za-z0-9], e.g. %Ga, %GL
248 if (!mutt_isalnum(str[1]))
249 return NULL;
250
251 // Let the basic expando parser do the work
252 flags |= EP_NO_CUSTOM_PARSE;
253 struct ExpandoNode *node = parse_short_name(str, IndexFormatDef, flags, fmt,
254 parsed_until, err);
255
256 // but adjust the node to take one more character
257 node->text = mutt_strn_dup((*parsed_until) - 1, 2);
258 (*parsed_until)++;
259
260 if (flags & EP_CONDITIONAL)
261 {
262 node->type = ENT_CONDBOOL;
264 }
265
266 return node;
267}
268
275struct ExpandoNode *parse_subject(const char *str, struct ExpandoFormat *fmt,
276 int did, int uid, ExpandoParserFlags flags,
277 const char **parsed_until, struct ExpandoParseError *err)
278{
279 // Let the basic expando parser do the work
280 flags |= EP_NO_CUSTOM_PARSE;
281 struct ExpandoNode *node_subj = parse_short_name(str, IndexFormatDef, flags,
282 NULL, parsed_until, err);
283
285 struct ExpandoNode *node_cont = node_container_new();
286
287 // Apply the formatting info to the container
288 node_cont->format = fmt;
289
290 node_add_child(node_cont, node_tree);
291 node_add_child(node_cont, node_subj);
292
293 return node_cont;
294}
295
312 // clang-format off
313 { "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
314 { ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
315 { "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
318 { "a", "from", ED_ENVELOPE, ED_ENV_FROM, NULL },
319 { "A", "reply-to", ED_ENVELOPE, ED_ENV_REPLY_TO, NULL },
320 { "b", "mailbox-name", ED_MAILBOX, ED_MBX_MAILBOX_NAME, NULL },
321 { "B", "list-address", ED_ENVELOPE, ED_ENV_LIST_ADDRESS, NULL },
322 { "cr", "body-characters", ED_EMAIL, ED_EMA_BODY_CHARACTERS, NULL },
323 { "c", "size", ED_EMAIL, ED_EMA_SIZE, NULL },
324 { "C", "number", ED_EMAIL, ED_EMA_NUMBER, NULL },
325 { "d", "date-format", ED_EMAIL, ED_EMA_DATE_FORMAT, NULL },
326 { "D", "date-format-local", ED_EMAIL, ED_EMA_DATE_FORMAT_LOCAL, NULL },
327 { "e", "thread-number", ED_EMAIL, ED_EMA_THREAD_NUMBER, NULL },
328 { "E", "thread-count", ED_EMAIL, ED_EMA_THREAD_COUNT, NULL },
329 { "f", "from-full", ED_ENVELOPE, ED_ENV_FROM_FULL, NULL },
330 { "Fp", "sender-plain", ED_ENVELOPE, ED_ENV_SENDER_PLAIN, NULL },
331 { "F", "sender", ED_ENVELOPE, ED_ENV_SENDER, NULL },
332 { "g", "tags", ED_EMAIL, ED_EMA_TAGS, NULL },
333 { "G", "tags-transformed", ED_EMAIL, ED_EMA_TAGS_TRANSFORMED, parse_tags_transformed },
334 { "H", "spam", ED_ENVELOPE, ED_ENV_SPAM, NULL },
335 { "i", "message-id", ED_ENVELOPE, ED_ENV_MESSAGE_ID, NULL },
336 { "I", "initials", ED_ENVELOPE, ED_ENV_INITIALS, NULL },
337 { "J", "thread-tags", ED_EMAIL, ED_EMA_THREAD_TAGS, NULL },
338 { "K", "list-empty", ED_ENVELOPE, ED_ENV_LIST_EMPTY, NULL },
339 { "l", "lines", ED_EMAIL, ED_EMA_LINES, NULL },
340 { "L", "from-list", ED_EMAIL, ED_EMA_FROM_LIST, NULL },
341 { "m", "message-count", ED_MAILBOX, ED_MBX_MESSAGE_COUNT, NULL },
342 { "M", "thread-hidden-count", ED_EMAIL, ED_EMA_THREAD_HIDDEN_COUNT, NULL },
343 { "n", "name", ED_ENVELOPE, ED_ENV_NAME, NULL },
344 { "N", "score", ED_EMAIL, ED_EMA_SCORE, NULL },
345 { "O", "save-folder", ED_EMAIL, ED_EMA_LIST_OR_SAVE_FOLDER, NULL },
346 { "P", "percentage", ED_MAILBOX, ED_MBX_PERCENTAGE, NULL },
347 { "q", "newsgroup", ED_ENVELOPE, ED_ENV_NEWSGROUP, NULL },
348 { "r", "to-all", ED_ENVELOPE, ED_ENV_TO_ALL, NULL },
349 { "R", "cc-all", ED_ENVELOPE, ED_ENV_CC_ALL, NULL },
350 { "s", "subject", ED_ENVELOPE, ED_ENV_SUBJECT, parse_subject },
351 { "S", "flag-chars", ED_EMAIL, ED_EMA_FLAG_CHARS, NULL },
352 { "t", "to", ED_ENVELOPE, ED_ENV_TO, NULL },
353 { "T", "to-chars", ED_EMAIL, ED_EMA_TO_CHARS, NULL },
354 { "u", "username", ED_ENVELOPE, ED_ENV_USERNAME, NULL },
355 { "v", "first-name", ED_ENVELOPE, ED_ENV_FIRST_NAME, NULL },
356 { "W", "organization", ED_ENVELOPE, ED_ENV_ORGANIZATION, NULL },
357 { "x", "x-comment-to", ED_ENVELOPE, ED_ENV_X_COMMENT_TO, NULL },
358 { "X", "attachment-count", ED_EMAIL, ED_EMA_ATTACHMENT_COUNT, NULL },
359 { "y", "x-label", ED_ENVELOPE, ED_ENV_X_LABEL, NULL },
360 { "Y", "thread-x-label", ED_ENVELOPE, ED_ENV_THREAD_X_LABEL, NULL },
361 { "Z", "combined-flags", ED_EMAIL, ED_EMA_COMBINED_FLAGS, NULL },
362 { "zc", "crypto-flags", ED_EMAIL, ED_EMA_CRYPTO_FLAGS, NULL },
363 { "zs", "status-flags", ED_EMAIL, ED_EMA_STATUS_FLAGS, NULL },
364 { "zt", "message-flags", ED_EMAIL, ED_EMA_MESSAGE_FLAGS, NULL },
367 { NULL, NULL, 0, -1, NULL }
368 // clang-format on
369};
370
373
376
380static struct ConfigDef MainVars[] = {
381 // clang-format off
382 { "abort_backspace", DT_BOOL, true, 0, NULL,
383 "Hitting backspace against an empty prompt aborts the prompt"
384 },
385 { "abort_key", DT_STRING|D_NOT_EMPTY|D_ON_STARTUP, IP "\007", 0, NULL,
386 "String representation of key to abort prompts"
387 },
388 { "ascii_chars", DT_BOOL, false, 0, NULL,
389 "Use plain ASCII characters, when drawing email threads"
390 },
392 "If a message is missing a character set, assume this character set"
393 },
394 { "attach_format", DT_EXPANDO|D_NOT_EMPTY, IP "%u%D%I %t%4n %T%d %> [%.7m/%.10M, %.6e%<C?, %C>, %s] ", IP &AttachFormatDef, NULL,
395 "printf-like format string for the attachment menu"
396 },
397 { "attach_save_dir", DT_PATH|D_PATH_DIR, IP "./", 0, NULL,
398 "Default directory where attachments are saved"
399 },
400 { "attach_save_without_prompting", DT_BOOL, false, 0, NULL,
401 "If true, then don't prompt to save"
402 },
403 { "attach_sep", DT_STRING, IP "\n", 0, NULL,
404 "Separator to add between saved/printed/piped attachments"
405 },
406 { "attach_split", DT_BOOL, true, 0, NULL,
407 "Save/print/pipe tagged messages individually"
408 },
409 { "auto_edit", DT_BOOL, false, 0, NULL,
410 "Skip the initial compose menu and edit the email"
411 },
412 { "auto_tag", DT_BOOL, false, 0, NULL,
413 "Automatically apply actions to all tagged messages"
414 },
415 { "beep", DT_BOOL, true, 0, NULL,
416 "Make a noise when an error occurs"
417 },
418 { "beep_new", DT_BOOL, false, 0, NULL,
419 "Make a noise when new mail arrives"
420 },
421 { "bounce", DT_QUAD, MUTT_ASKYES, 0, NULL,
422 "Confirm before bouncing a message"
423 },
424 { "braille_friendly", DT_BOOL, false, 0, NULL,
425 "Move the cursor to the beginning of the line"
426 },
428 "Default character set for displaying text on screen"
429 },
430 { "collapse_flagged", DT_BOOL, true, 0, NULL,
431 "Prevent the collapse of threads with flagged emails"
432 },
433 { "collapse_unread", DT_BOOL, true, 0, NULL,
434 "Prevent the collapse of threads with unread emails"
435 },
436 { "color_directcolor", DT_BOOL|D_ON_STARTUP, false, 0, NULL,
437 "Use 24bit colors (aka truecolor aka directcolor)"
438 },
439 { "config_charset", DT_STRING, 0, 0, charset_validator,
440 "Character set that the config files are in"
441 },
442 { "confirm_append", DT_BOOL, true, 0, NULL,
443 "Confirm before appending emails to a mailbox"
444 },
445 { "confirm_create", DT_BOOL, true, 0, NULL,
446 "Confirm before creating a new mailbox"
447 },
448 { "copy_decode_weed", DT_BOOL, false, 0, NULL,
449 "Controls whether to weed headers when copying or saving emails"
450 },
451 { "count_alternatives", DT_BOOL, false, 0, NULL,
452 "Recurse inside multipart/alternatives while counting attachments"
453 },
454 { "crypt_chars", DT_MBTABLE, IP "SPsK ", 0, NULL,
455 "User-configurable crypto flags: signed, encrypted etc."
456 },
457 { "date_format", DT_STRING|D_NOT_EMPTY, IP "!%a, %b %d, %Y at %I:%M:%S%p %Z", 0, NULL,
458 "strftime format string for the `%d` expando"
459 },
460 { "debug_file", DT_PATH|D_PATH_FILE, IP "~/.neomuttdebug", 0, NULL,
461 "File to save debug logs"
462 },
463 { "debug_level", DT_NUMBER, 0, 0, level_validator,
464 "Logging level for debug logs"
465 },
466 { "default_hook", DT_STRING, IP "~f %s !~P | (~P ~C %s)", 0, NULL,
467 "Pattern to use for hooks that only have a simple regex"
468 },
469 { "delete", DT_QUAD, MUTT_ASKYES, 0, NULL,
470 "Really delete messages, when the mailbox is closed"
471 },
472 { "delete_untag", DT_BOOL, true, 0, NULL,
473 "Untag messages when they are marked for deletion"
474 },
475 { "digest_collapse", DT_BOOL, true, 0, NULL,
476 "Hide the subparts of a multipart/digest"
477 },
478 { "duplicate_threads", DT_BOOL, true, 0, NULL,
479 "Highlight messages with duplicated message IDs"
480 },
481 { "editor", DT_STRING|D_NOT_EMPTY|D_STRING_COMMAND, 0, 0, NULL,
482 "External command to use as an email editor"
483 },
484 { "flag_chars", DT_MBTABLE, IP "*!DdrONon- ", 0, NULL,
485 "User-configurable index flags: tagged, new, etc"
486 },
487 { "flag_safe", DT_BOOL, false, 0, NULL,
488 "Protect flagged messages from deletion"
489 },
490 { "folder", DT_STRING|D_STRING_MAILBOX, IP "~/Mail", 0, NULL,
491 "Base folder for a set of mailboxes"
492 },
493 { "force_name", DT_BOOL, false, 0, NULL,
494 "Save outgoing mail in a folder of their name"
495 },
496 { "forward_decode", DT_BOOL, true, 0, NULL,
497 "Decode the message when forwarding it"
498 },
499 { "forward_quote", DT_BOOL, false, 0, NULL,
500 "Automatically quote a forwarded message using `$indent_string`"
501 },
502 { "from", DT_ADDRESS, 0, 0, NULL,
503 "Default 'From' address to use, if isn't otherwise set"
504 },
505 { "from_chars", DT_MBTABLE, 0, 0, NULL,
506 "User-configurable index flags: to address, cc address, etc"
507 },
508 { "gecos_mask", DT_REGEX, IP "^[^,]*", 0, NULL,
509 "Regex for parsing GECOS field of /etc/passwd"
510 },
511 { "header", DT_BOOL, false, 0, NULL,
512 "Include the message headers in the reply email (Weed applies)"
513 },
514 { "hide_limited", DT_BOOL, false, 0, NULL,
515 "Don't indicate hidden messages, in the thread tree"
516 },
517 { "hide_missing", DT_BOOL, true, 0, NULL,
518 "Don't indicate missing messages, in the thread tree"
519 },
520 { "hide_thread_subject", DT_BOOL, true, 0, NULL,
521 "Hide subjects that are similar to that of the parent message"
522 },
523 { "hide_top_limited", DT_BOOL, false, 0, NULL,
524 "Don't indicate hidden top message, in the thread tree"
525 },
526 { "hide_top_missing", DT_BOOL, true, 0, NULL,
527 "Don't indicate missing top message, in the thread tree"
528 },
529 { "honor_disposition", DT_BOOL, false, 0, NULL,
530 "Don't display MIME parts inline if they have a disposition of 'attachment'"
531 },
532 { "hostname", DT_STRING, 0, 0, NULL,
533 "Fully-qualified domain name of this machine"
534 },
535 { "implicit_auto_view", DT_BOOL, false, 0, NULL,
536 "Display MIME attachments inline if a 'copiousoutput' mailcap entry exists"
537 },
538 { "include_encrypted", DT_BOOL, false, 0, NULL,
539 "Whether to include encrypted content when replying"
540 },
541 { "include_only_first", DT_BOOL, false, 0, NULL,
542 "Only include the first attachment when replying"
543 },
544 { "indent_string", DT_EXPANDO, IP "> ", IP IndexFormatDefNoPadding, NULL,
545 "String used to indent 'reply' text"
546 },
547 { "index_format", DT_EXPANDO|D_NOT_EMPTY, IP "%4C %Z %{%b %d} %-15.15L (%<l?%4l&%4c>) %s", IP &IndexFormatDef, NULL,
548 "printf-like format string for the index menu (emails)"
549 },
550 { "keep_flagged", DT_BOOL, false, 0, NULL,
551 "Don't move flagged messages from `$spool_file` to `$mbox`"
552 },
553 { "local_date_header", DT_BOOL, true, 0, NULL,
554 "Convert the date in the Date header of sent emails into local timezone, UTC otherwise"
555 },
556 { "mail_check", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 5, 0, NULL,
557 "Number of seconds before NeoMutt checks for new mail"
558 },
559 { "mail_check_recent", DT_BOOL, true, 0, NULL,
560 "Notify the user about new mail since the last time the mailbox was opened"
561 },
562 { "mail_check_stats", DT_BOOL, false, 0, NULL,
563 "Periodically check for new mail"
564 },
565 { "mail_check_stats_interval", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 60, 0, NULL,
566 "How often to check for new mail"
567 },
568 { "mailcap_path", DT_SLIST|D_SLIST_SEP_COLON, IP "~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap", 0, NULL,
569 "List of mailcap files (colon-separated)"
570 },
571 { "mailcap_sanitize", DT_BOOL, true, 0, NULL,
572 "Restrict the possible characters in mailcap expandos"
573 },
574 { "mark_old", DT_BOOL, true, 0, NULL,
575 "Mark new emails as old when leaving the mailbox"
576 },
577 { "mbox", DT_STRING|D_STRING_MAILBOX, IP "~/mbox", 0, NULL,
578 "Folder that receives read emails (see Move)"
579 },
580 { "mbox_type", DT_ENUM, MUTT_MBOX, IP &MboxTypeDef, NULL,
581 "Default type for creating new mailboxes"
582 },
583 { "message_cache_clean", DT_BOOL, false, 0, NULL,
584 "(imap/pop) Clean out obsolete entries from the message cache"
585 },
586 { "message_cache_dir", DT_PATH|D_PATH_DIR, 0, 0, NULL,
587 "(imap/pop) Directory for the message cache"
588 },
589 { "message_format", DT_EXPANDO|D_NOT_EMPTY, IP "%s", IP &IndexFormatDef, NULL,
590 "printf-like format string for listing attached messages"
591 },
592 { "meta_key", DT_BOOL, false, 0, NULL,
593 "Interpret 'ALT-x' as 'ESC-x'"
594 },
595 { "mime_forward", DT_QUAD, MUTT_NO, 0, NULL,
596 "Forward a message as a 'message/RFC822' MIME part"
597 },
598 { "mime_forward_rest", DT_QUAD, MUTT_YES, 0, NULL,
599 "Forward all attachments, even if they can't be decoded"
600 },
601 { "move", DT_QUAD, MUTT_NO, 0, NULL,
602 "Move emails from `$spool_file` to `$mbox` when read"
603 },
604 { "narrow_tree", DT_BOOL, false, 0, NULL,
605 "Draw a narrower thread tree in the index"
606 },
607 { "new_mail_command", DT_EXPANDO|D_STRING_COMMAND, 0, IP StatusFormatDefNoPadding, NULL,
608 "External command to run when new mail arrives"
609 },
610 { "pipe_decode", DT_BOOL, false, 0, NULL,
611 "Decode the message when piping it"
612 },
613 { "pipe_decode_weed", DT_BOOL, true, 0, NULL,
614 "Control whether to weed headers when piping an email"
615 },
616 { "pipe_sep", DT_STRING, IP "\n", 0, NULL,
617 "Separator to add between multiple piped messages"
618 },
619 { "pipe_split", DT_BOOL, false, 0, NULL,
620 "Run the pipe command on each message separately"
621 },
622 { "postponed", DT_STRING|D_STRING_MAILBOX, IP "~/postponed", 0, NULL,
623 "Folder to store postponed messages"
624 },
625 { "preferred_languages", DT_SLIST|D_SLIST_SEP_COMMA, 0, 0, NULL,
626 "List of Preferred Languages for multilingual MIME (comma-separated)"
627 },
628 { "print", DT_QUAD, MUTT_ASKNO, 0, NULL,
629 "Confirm before printing a message"
630 },
631 { "print_command", DT_STRING|D_STRING_COMMAND, IP "lpr", 0, NULL,
632 "External command to print a message"
633 },
634 { "print_decode", DT_BOOL, true, 0, NULL,
635 "Decode message before printing it"
636 },
637 { "print_decode_weed", DT_BOOL, true, 0, NULL,
638 "Control whether to weed headers when printing an email"
639 },
640 { "print_split", DT_BOOL, false, 0, NULL,
641 "Print multiple messages separately"
642 },
643 { "quit", DT_QUAD, MUTT_YES, 0, NULL,
644 "Prompt before exiting NeoMutt"
645 },
646 { "quote_regex", DT_REGEX, IP "^([ \t]*[|>:}#])+", 0, NULL,
647 "Regex to match quoted text in a reply"
648 },
649 { "read_only", DT_BOOL, false, 0, NULL,
650 "Open folders in read-only mode"
651 },
652 { "real_name", DT_STRING, 0, 0, NULL,
653 "Real name of the user"
654 },
655 { "record", DT_STRING|D_STRING_MAILBOX, IP "~/sent", 0, NULL,
656 "Folder to save 'sent' messages"
657 },
658 { "reflow_space_quotes", DT_BOOL, true, 0, NULL,
659 "Insert spaces into reply quotes for 'format=flowed' messages"
660 },
661 { "reflow_text", DT_BOOL, true, 0, NULL,
662 "Reformat paragraphs of 'format=flowed' text"
663 },
664 { "reflow_wrap", DT_NUMBER, 78, 0, NULL,
665 "Maximum paragraph width for reformatting 'format=flowed' text"
666 },
667 { "resolve", DT_BOOL, true, 0, NULL,
668 "Move to the next email whenever a command modifies an email"
669 },
670 { "resume_edited_draft_files", DT_BOOL, true, 0, NULL,
671 "Resume editing previously saved draft files"
672 },
673 { "save_address", DT_BOOL, false, 0, NULL,
674 "Use sender's full address as a default save folder"
675 },
676 { "save_empty", DT_BOOL, true, 0, NULL,
677 "(mbox,mmdf) Preserve empty mailboxes"
678 },
679 { "save_name", DT_BOOL, false, 0, NULL,
680 "Save outgoing message to mailbox of recipient's name if it exists"
681 },
682 { "score", DT_BOOL, true, 0, NULL,
683 "Use message scoring"
684 },
685 { "score_threshold_delete", DT_NUMBER, -1, 0, NULL,
686 "Messages with a lower score will be automatically deleted"
687 },
688 { "score_threshold_flag", DT_NUMBER, 9999, 0, NULL,
689 "Messages with a greater score will be automatically flagged"
690 },
691 { "score_threshold_read", DT_NUMBER, -1, 0, NULL,
692 "Messages with a lower score will be automatically marked read"
693 },
694 { "send_charset", DT_SLIST|D_SLIST_SEP_COLON|D_SLIST_ALLOW_EMPTY|D_CHARSET_STRICT, IP "us-ascii:iso-8859-1:utf-8", 0, charset_slist_validator,
695 "Character sets for outgoing mail"
696 },
697 { "shell", DT_STRING|D_STRING_COMMAND, IP "/bin/sh", 0, NULL,
698 "External command to run subshells in"
699 },
700 { "show_multipart_alternative", DT_STRING, 0, 0, multipart_validator,
701 "How to display 'multipart/alternative' MIME parts"
702 },
703 { "simple_search", DT_STRING, IP "~f %s | ~s %s", 0, NULL,
704 "Pattern to search for when search doesn't contain ~'s"
705 },
706 { "size_show_bytes", DT_BOOL, false, 0, NULL,
707 "Show smaller sizes in bytes"
708 },
709 { "size_show_fractions", DT_BOOL, true, 0, NULL,
710 "Show size fractions with a single decimal place"
711 },
712 { "size_show_mb", DT_BOOL, true, 0, NULL,
713 "Show sizes in megabytes for sizes greater than 1 megabyte"
714 },
715 { "size_units_on_left", DT_BOOL, false, 0, NULL,
716 "Show the units as a prefix to the size"
717 },
718 { "sleep_time", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 1, 0, NULL,
719 "Time to pause after certain info messages"
720 },
722 "Sort method for the index"
723 },
725 "Secondary sort method for the index"
726 },
727 { "sort_re", DT_BOOL, true, 0, NULL,
728 "Whether $reply_regex must be matched when not $strict_threads"
729 },
730 { "spool_file", DT_STRING|D_STRING_MAILBOX, 0, 0, NULL,
731 "Inbox"
732 },
733 { "status_chars", DT_MBTABLE, IP "-*%A", 0, NULL,
734 "Indicator characters for the status bar"
735 },
736 { "status_on_top", DT_BOOL, false, 0, NULL,
737 "Display the status bar at the top"
738 },
739 { "strict_threads", DT_BOOL, false, 0, NULL,
740 "Thread messages using 'In-Reply-To' and 'References' headers"
741 },
742 { "suspend", DT_BOOL, true, 0, NULL,
743 "Allow the user to suspend NeoMutt using '^Z'"
744 },
745 { "text_flowed", DT_BOOL, false, 0, NULL,
746 "Generate 'format=flowed' messages"
747 },
748 { "thread_received", DT_BOOL, false, 0, NULL,
749 "Sort threaded messages by their received date"
750 },
751 { "timeout", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 600, 0, NULL,
752 "Time to wait for user input in menus"
753 },
754 { "tmp_dir", DT_PATH|D_PATH_DIR|D_NOT_EMPTY, IP TMPDIR, 0, NULL,
755 "Directory for temporary files"
756 },
757 { "to_chars", DT_MBTABLE, IP " +TCFLR", 0, NULL,
758 "Indicator characters for the 'To' field in the index"
759 },
760 { "trash", DT_STRING|D_STRING_MAILBOX, 0, 0, NULL,
761 "Folder to put deleted emails"
762 },
763 { "ts_enabled", DT_BOOL, false, 0, NULL,
764 "Allow NeoMutt to set the terminal status line and icon"
765 },
766 // L10N: $ts_icon_format default format
767 { "ts_icon_format", DT_EXPANDO|D_L10N_STRING, IP N_("M%<n?AIL&ail>"), IP StatusFormatDefNoPadding, NULL,
768 "printf-like format string for the terminal's icon title"
769 },
770 // L10N: $ts_status_format default format
771 { "ts_status_format", DT_EXPANDO|D_L10N_STRING, IP N_("NeoMutt with %<m?%m messages&no messages>%<n? [%n NEW]>"), IP StatusFormatDefNoPadding, NULL,
772 "printf-like format string for the terminal's status (window title)"
773 },
774 { "use_domain", DT_BOOL, true, 0, NULL,
775 "Qualify local addresses using this domain"
776 },
777 { "use_threads", DT_ENUM, UT_UNSET, IP &UseThreadsTypeDef, NULL,
778 "Whether to use threads for the index"
779 },
780 { "wait_key", DT_BOOL, true, 0, NULL,
781 "Prompt to press a key after running external commands"
782 },
783 { "weed", DT_BOOL, true, 0, NULL,
784 "Filter headers when displaying/forwarding/printing/replying"
785 },
786 { "wrap", DT_NUMBER, 0, 0, NULL,
787 "Width to wrap text in the pager"
788 },
789 { "wrap_search", DT_BOOL, true, 0, NULL,
790 "Wrap around when the search hits the end"
791 },
792
793 { "cursor_overlay", D_INTERNAL_DEPRECATED|DT_BOOL, 0, IP "2020-07-20" },
794 { "escape", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2021-03-18" },
795 { "ignore_linear_white_space", D_INTERNAL_DEPRECATED|DT_BOOL, 0, IP "2021-03-18" },
796 { "mixmaster", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2024-05-30" },
797 { "mix_entry_format", D_INTERNAL_DEPRECATED|DT_EXPANDO,0, IP "2024-05-30" },
798 { "visual", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2021-03-18" },
799
800 { "autoedit", DT_SYNONYM, IP "auto_edit", IP "2021-03-21" },
801 { "confirmappend", DT_SYNONYM, IP "confirm_append", IP "2021-03-21" },
802 { "confirmcreate", DT_SYNONYM, IP "confirm_create", IP "2021-03-21" },
803 { "edit_hdrs", DT_SYNONYM, IP "edit_headers", IP "2021-03-21" },
804 { "forw_decode", DT_SYNONYM, IP "forward_decode", IP "2021-03-21" },
805 { "forw_quote", DT_SYNONYM, IP "forward_quote", IP "2021-03-21" },
806 { "hdr_format", DT_SYNONYM, IP "index_format", IP "2021-03-21" },
807 { "implicit_autoview", DT_SYNONYM, IP "implicit_auto_view", IP "2023-01-25" },
808 { "include_onlyfirst", DT_SYNONYM, IP "include_only_first", IP "2021-03-21" },
809 { "indent_str", DT_SYNONYM, IP "indent_string", IP "2021-03-21" },
810 { "message_cachedir", DT_SYNONYM, IP "message_cache_dir", IP "2023-01-25" },
811 { "mime_fwd", DT_SYNONYM, IP "mime_forward", IP "2021-03-21" },
812 { "msg_format", DT_SYNONYM, IP "message_format", IP "2021-03-21" },
813 { "print_cmd", DT_SYNONYM, IP "print_command", IP "2021-03-21" },
814 { "quote_regexp", DT_SYNONYM, IP "quote_regex", IP "2021-03-21" },
815 { "realname", DT_SYNONYM, IP "real_name", IP "2021-03-21" },
816 { "spoolfile", DT_SYNONYM, IP "spool_file", IP "2021-03-21" },
817 { "tmpdir", DT_SYNONYM, IP "tmp_dir", IP "2023-01-25" },
818 { "xterm_icon", DT_SYNONYM, IP "ts_icon_format", IP "2021-03-21" },
819 { "xterm_set_titles", DT_SYNONYM, IP "ts_enabled", IP "2021-03-21" },
820 { "xterm_title", DT_SYNONYM, IP "ts_status_format", IP "2021-03-21" },
821
822 { "devel_security", DT_BOOL, false, 0, NULL,
823 "Devel feature: Security -- https://github.com/neomutt/neomutt/discussions/4251"
824 },
825
826 { NULL },
827 // clang-format on
828};
829
830#if defined(HAVE_LIBIDN)
834static struct ConfigDef MainVarsIdn[] = {
835 // clang-format off
836 { "idn_decode", DT_BOOL, true, 0, NULL,
837 "(idn) Decode international domain names"
838 },
839 { "idn_encode", DT_BOOL, true, 0, NULL,
840 "(idn) Encode international domain names"
841 },
842 { NULL },
843 // clang-format on
844};
845#endif
846
850static bool config_init_main(struct ConfigSet *cs)
851{
852 bool rc = cs_register_variables(cs, MainVars);
853
854#if defined(HAVE_LIBIDN)
856#endif
857
858 return rc;
859}
860
867static void init_types(struct ConfigSet *cs)
868{
870 CONFIG_INIT_TYPE(cs, Bool);
871 CONFIG_INIT_TYPE(cs, Enum);
873 CONFIG_INIT_TYPE(cs, Long);
874 CONFIG_INIT_TYPE(cs, Mbtable);
875 CONFIG_INIT_TYPE(cs, MyVar);
876 CONFIG_INIT_TYPE(cs, Number);
877 CONFIG_INIT_TYPE(cs, Path);
878 CONFIG_INIT_TYPE(cs, Quad);
881 CONFIG_INIT_TYPE(cs, Sort);
882 CONFIG_INIT_TYPE(cs, String);
883}
884
889static void init_variables(struct ConfigSet *cs)
890{
891 // Define the config variables
893 CONFIG_INIT_VARS(cs, alias);
894#if defined(USE_AUTOCRYPT)
895 CONFIG_INIT_VARS(cs, autocrypt);
896#endif
897 CONFIG_INIT_VARS(cs, browser);
898 CONFIG_INIT_VARS(cs, compose);
899 CONFIG_INIT_VARS(cs, conn);
900 CONFIG_INIT_VARS(cs, email);
901#if defined(USE_HCACHE)
902 CONFIG_INIT_VARS(cs, hcache);
903#endif
904 CONFIG_INIT_VARS(cs, helpbar);
905 CONFIG_INIT_VARS(cs, history);
906 CONFIG_INIT_VARS(cs, imap);
907 CONFIG_INIT_VARS(cs, index);
908 CONFIG_INIT_VARS(cs, maildir);
909 CONFIG_INIT_VARS(cs, mbox);
910 CONFIG_INIT_VARS(cs, menu);
911 CONFIG_INIT_VARS(cs, mh);
912 CONFIG_INIT_VARS(cs, ncrypt);
913 CONFIG_INIT_VARS(cs, nntp);
914#if defined(USE_NOTMUCH)
915 CONFIG_INIT_VARS(cs, notmuch);
916#endif
917 CONFIG_INIT_VARS(cs, pager);
918 CONFIG_INIT_VARS(cs, pattern);
919 CONFIG_INIT_VARS(cs, pop);
920 CONFIG_INIT_VARS(cs, progress);
922 CONFIG_INIT_VARS(cs, sidebar);
923}
924
929void init_config(struct ConfigSet *cs)
930{
931 init_types(cs);
932 init_variables(cs);
933}
GUI display the mailboxes in a side panel.
@ ED_ATT_NUMBER
AttachPtr.num.
Definition: attach.h:55
@ ED_ATT_TREE
AttachPtr.tree.
Definition: attach.h:56
@ ED_ATT_CHARSET
AttachPtr.body.
Definition: attach.h:54
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:161
Convenience wrapper for the config headers.
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition: set.c:289
#define CSR_ERR_INVALID
Value hasn't been set.
Definition: set.h:36
#define CSR_SUCCESS
Action completed successfully.
Definition: set.h:33
#define IP
Definition: set.h:52
Convenience wrapper for the core headers.
@ ED_MBX_MESSAGE_COUNT
Mailbox.msg_count.
Definition: mailbox.h:158
@ ED_MBX_PERCENTAGE
EmailFormatInfo.pager_progress.
Definition: mailbox.h:159
@ ED_MBX_MAILBOX_NAME
Mailbox, mailbox_path()
Definition: mailbox.h:157
@ MUTT_MBOX
'mbox' Mailbox type
Definition: mailbox.h:45
bool mutt_isalnum(int arg)
Wrapper for isalnum(3)
Definition: ctype.c:39
#define EP_NO_CUSTOM_PARSE
Don't use the custom parser.
Definition: definition.h:36
uint8_t ExpandoParserFlags
Flags for expando_parse(), e.g. EP_CONDITIONAL.
Definition: definition.h:33
#define EP_CONDITIONAL
Expando is being used as a condition.
Definition: definition.h:35
@ ED_ENVELOPE
Envelope ED_ENV_ ExpandoDataEnvelope.
Definition: domain.h:42
@ ED_EMAIL
Email ED_EMA_ ExpandoDataEmail.
Definition: domain.h:41
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition: domain.h:44
@ ED_BODY
Body ED_BOD_ ExpandoDataBody.
Definition: domain.h:38
@ ED_MAILBOX
Mailbox ED_MBX_ ExpandoDataMailbox.
Definition: domain.h:47
@ ED_ATTACH
Attach ED_ATT_ ExpandoDataAttach.
Definition: domain.h:36
@ ED_BOD_DESCRIPTION
Body.description.
Definition: body.h:106
@ ED_BOD_CHARSET_CONVERT
Body.type.
Definition: body.h:104
@ ED_BOD_DELETED
Body.deleted.
Definition: body.h:105
@ ED_BOD_UNLINK
Body.unlink.
Definition: body.h:115
@ ED_BOD_FILE_SIZE
Body.filename.
Definition: body.h:110
@ ED_BOD_DISPOSITION
Body.disposition.
Definition: body.h:107
@ ED_BOD_ATTACH_QUALIFIES
Body.attach_qualifies.
Definition: body.h:103
@ ED_BOD_MIME_MAJOR
Body.type, Body.xtype.
Definition: body.h:112
@ ED_BOD_TAGGED
Body.tagged.
Definition: body.h:114
@ ED_BOD_ATTACH_COUNT
Body.attach_count.
Definition: body.h:102
@ ED_BOD_FILE
Body.filename.
Definition: body.h:108
@ ED_BOD_MIME_MINOR
Body.subtype.
Definition: body.h:113
@ ED_BOD_FILE_DISPOSITION
Body.d_filename.
Definition: body.h:109
@ ED_BOD_MIME_ENCODING
Body.encoding.
Definition: body.h:111
Structs that make up an email.
@ EMAIL_SORT_LABEL
Sort by the emails label.
Definition: sort.h:57
@ EMAIL_SORT_DATE_RECEIVED
Sort by when the message were delivered locally.
Definition: sort.h:55
@ EMAIL_SORT_SPAM
Sort by the email's spam score.
Definition: sort.h:60
@ EMAIL_SORT_SCORE
Sort by the email's score.
Definition: sort.h:58
@ EMAIL_SORT_DATE
Sort by the date the email was sent.
Definition: sort.h:54
@ EMAIL_SORT_THREADS
Sort by email threads.
Definition: sort.h:62
@ EMAIL_SORT_SUBJECT
Sort by the email's subject.
Definition: sort.h:61
@ EMAIL_SORT_FROM
Sort by the email's From field.
Definition: sort.h:56
@ EMAIL_SORT_UNSORTED
Sort by the order the messages appear in the mailbox.
Definition: sort.h:64
@ EMAIL_SORT_SIZE
Sort by the size of the email.
Definition: sort.h:59
@ EMAIL_SORT_TO
Sort by the email's To field.
Definition: sort.h:63
@ ED_EMA_DATE_STRF_LOCAL
Email.date_sent.
Definition: email.h:143
@ ED_EMA_ATTACHMENT_COUNT
Email, mutt_count_body_parts()
Definition: email.h:136
@ ED_EMA_DATE_FORMAT_LOCAL
Email.date_sent.
Definition: email.h:141
@ ED_EMA_TAGS_TRANSFORMED
Email.tags, driver_tags_get_transformed()
Definition: email.h:156
@ ED_EMA_THREAD_HIDDEN_COUNT
Email.collapsed, Email.num_hidden, ...
Definition: email.h:158
@ ED_EMA_DATE_FORMAT
Email.date_sent.
Definition: email.h:140
@ ED_EMA_THREAD_TAGS
Email.tags.
Definition: email.h:160
@ ED_EMA_TAGS
Email.tags.
Definition: email.h:155
@ ED_EMA_SIZE
Body.length.
Definition: email.h:152
@ ED_EMA_FLAG_CHARS
Email.deleted, Email.attach_del, ...
Definition: email.h:144
@ ED_EMA_THREAD_NUMBER
Email, mutt_messages_in_thread()
Definition: email.h:159
@ ED_EMA_TO_CHARS
Email, User_is_recipient()
Definition: email.h:161
@ ED_EMA_BODY_CHARACTERS
Body.length.
Definition: email.h:137
@ ED_EMA_COMBINED_FLAGS
Email.read, Email.old, thread_is_new(), ...
Definition: email.h:138
@ ED_EMA_THREAD_COUNT
Email, mutt_messages_in_thread()
Definition: email.h:157
@ ED_EMA_STATUS_FLAGS
Email.deleted, Email.attach_del, ...
Definition: email.h:153
@ ED_EMA_NUMBER
Email.msgno.
Definition: email.h:150
@ ED_EMA_DATE_STRF
Email.date_sent, Email.zhours, Email.zminutes, Email.zoccident.
Definition: email.h:142
@ ED_EMA_FROM_LIST
Envelope.to, Envelope.cc.
Definition: email.h:145
@ ED_EMA_SCORE
Email.score.
Definition: email.h:151
@ ED_EMA_CRYPTO_FLAGS
Email.security, SecurityFlags.
Definition: email.h:139
@ ED_EMA_STRF_RECV_LOCAL
Email.received.
Definition: email.h:154
@ ED_EMA_LIST_OR_SAVE_FOLDER
Envelope.to, Envelope.cc, check_for_mailing_list()
Definition: email.h:148
@ ED_EMA_INDEX_HOOK
Mailbox, Email, mutt_idxfmt_hook()
Definition: email.h:146
@ ED_EMA_LINES
Email.lines.
Definition: email.h:147
@ ED_EMA_MESSAGE_FLAGS
Email.tagged, Email.flagged.
Definition: email.h:149
@ ED_ENV_SUBJECT
Envelope.subject, Envelope.disp_subj.
Definition: envelope.h:116
@ ED_ENV_NEWSGROUP
Envelope.newsgroups.
Definition: envelope.h:109
@ ED_ENV_INITIALS
Envelope.from (first)
Definition: envelope.h:104
@ ED_ENV_FROM_FULL
Envelope.from (all)
Definition: envelope.h:103
@ ED_ENV_X_COMMENT_TO
Envelope.x_comment_to.
Definition: envelope.h:123
@ ED_ENV_FROM
Envelope.from (first)
Definition: envelope.h:102
@ ED_ENV_LIST_ADDRESS
Envelope.to, Envelope.cc.
Definition: envelope.h:105
@ ED_ENV_SPAM
Envelope.spam.
Definition: envelope.h:115
@ ED_ENV_SENDER
Envelope, make_from()
Definition: envelope.h:113
@ ED_ENV_TO_ALL
Envelope.to (all)
Definition: envelope.h:120
@ ED_ENV_X_LABEL
Envelope.x_label.
Definition: envelope.h:124
@ ED_ENV_NAME
Envelope.from (first)
Definition: envelope.h:108
@ ED_ENV_CC_ALL
Envelope.cc.
Definition: envelope.h:100
@ ED_ENV_ORGANIZATION
Envelope.organization.
Definition: envelope.h:110
@ ED_ENV_REPLY_TO
Envelope.reply_to.
Definition: envelope.h:112
@ ED_ENV_LIST_EMPTY
Envelope.to, Envelope.cc.
Definition: envelope.h:106
@ ED_ENV_THREAD_X_LABEL
Envelope.x_label.
Definition: envelope.h:118
@ ED_ENV_MESSAGE_ID
Envelope.message_id.
Definition: envelope.h:107
@ ED_ENV_SENDER_PLAIN
Envelope, make_from()
Definition: envelope.h:114
@ ED_ENV_USERNAME
Envelope.from.
Definition: envelope.h:121
@ ED_ENV_THREAD_TREE
Email.tree.
Definition: envelope.h:117
@ ED_ENV_TO
Envelope.to, Envelope.cc (first)
Definition: envelope.h:119
@ ED_ENV_FIRST_NAME
Envelope.from, Envelope.to, Envelope.cc.
Definition: envelope.h:101
Parse Expando string.
int sort_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "sort" config variable - Implements ConfigDef::validator() -.
Definition: mutt_thread.c:107
static int multipart_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "show_multipart_alternative" config variable - Implements ConfigDef::validator() -.
Definition: mutt_config.c:110
int charset_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "charset" config variables - Implements ConfigDef::validator() -.
Definition: charset.c:45
int level_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "debug_level" config variable - Implements ConfigDef::validator() -.
Definition: mutt_logging.c:270
int charset_slist_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the multiple "charset" config variables - Implements ConfigDef::validator() -.
Definition: charset.c:84
static bool config_init_main(struct ConfigSet *cs)
Register main config variables - Implements module_init_config_t -.
Definition: mutt_config.c:850
struct ExpandoNode * node_padding_parse(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Padding Expando - Implements ExpandoDefinition::parse() -.
Definition: node_padding.c:234
struct ExpandoNode * parse_index_hook(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse an index-hook - Implements ExpandoDefinition::parse() -.
Definition: mutt_config.c:221
struct ExpandoNode * parse_subject(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Subject Expando - Implements ExpandoDefinition::parse() -.
Definition: mutt_config.c:275
struct ExpandoNode * parse_index_date_recv_local(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Date Expando - Implements ExpandoDefinition::parse() -.
Definition: mutt_config.c:162
struct ExpandoNode * parse_index_date_local(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Date Expando - Implements ExpandoDefinition::parse() -.
Definition: mutt_config.c:182
struct ExpandoNode * parse_index_date(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Date Expando - Implements ExpandoDefinition::parse() -.
Definition: mutt_config.c:201
struct ExpandoNode * parse_tags_transformed(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Tags-Transformed Expando - Implements ExpandoDefinition::parse() -.
Definition: mutt_config.c:242
int node_condbool_render(const struct ExpandoNode *node, const struct ExpandoRenderCallback *erc, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Callback for every bool node - Implements ExpandoNode::render() -.
Definition: node_condbool.c:41
const struct ExpandoDefinition StatusFormatDef[]
Expando definitions.
Definition: config.c:47
GUI manage the main index (list of emails)
Convenience wrapper for the library headers.
#define N_(a)
Definition: message.h:32
#define _(a)
Definition: message.h:28
static bool send(struct Notify *source, struct Notify *current, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:120
char * mutt_strn_dup(const char *begin, size_t len)
Duplicate a sub-string.
Definition: string.c:381
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:659
#define CONFIG_INIT_VARS(CS, NAME)
Definition: mutt_config.c:57
static void init_types(struct ConfigSet *cs)
Create the config types.
Definition: mutt_config.c:867
const struct Mapping SortMethods[]
Sort methods for '$sort' for the index.
Definition: mutt_config.c:87
#define CONFIG_INIT_TYPE(CS, NAME)
Definition: mutt_config.c:53
void init_config(struct ConfigSet *cs)
Initialise the config system.
Definition: mutt_config.c:929
static struct ConfigDef MainVarsIdn[]
IDN Config definitions.
Definition: mutt_config.c:834
const struct ExpandoDefinition *const StatusFormatDefNoPadding
StatusFormatDefNoPadding - Status format definitions, without padding.
Definition: mutt_config.c:375
static void init_variables(struct ConfigSet *cs)
Define the config variables.
Definition: mutt_config.c:889
static const struct ExpandoDefinition *const IndexFormatDefNoPadding
IndexFormatDefNoPadding - Index format definitions, without padding.
Definition: mutt_config.c:372
static struct ConfigDef MainVars[]
General Config definitions for NeoMutt.
Definition: mutt_config.c:380
static const struct Mapping SortAuxMethods[]
Sort methods for '$sort_aux' for the index.
Definition: mutt_config.c:64
const struct ExpandoDefinition IndexFormatDef[]
Expando definitions.
Definition: mutt_config.c:311
static const struct ExpandoDefinition AttachFormatDef[]
Expando definitions.
Definition: mutt_config.c:130
NeoMutt Logging.
const struct EnumDef UseThreadsTypeDef
Data for the $use_threads enumeration.
Definition: mutt_thread.c:66
Create/manipulate threading in emails.
@ UT_UNSET
Not yet set by user, stick to legacy semantics.
Definition: mutt_thread.h:97
const struct EnumDef MboxTypeDef
Data for the $mbox_type enumeration.
Definition: mx.c:92
API for mailboxes.
void node_add_child(struct ExpandoNode *node, struct ExpandoNode *child)
Add a child to an ExpandoNode.
Definition: node.c:76
@ ENT_CONDBOOL
True/False boolean condition.
Definition: node.h:42
struct ExpandoNode * node_conddate_parse(const char *str, int did, int uid, const char **parsed_until, struct ExpandoParseError *err)
Parse a CondDate format string.
struct ExpandoNode * node_container_new(void)
Create a new Container ExpandoNode.
struct ExpandoNode * node_expando_new(struct ExpandoFormat *fmt, int did, int uid)
Create a new Expando ExpandoNode.
Definition: node_expando.c:77
struct ExpandoNode * node_expando_parse_enclosure(const char *str, int did, int uid, char terminator, struct ExpandoFormat *fmt, const char **parsed_until, struct ExpandoParseError *err)
Parse an enclosed Expando.
Definition: node_expando.c:348
struct ExpandoNode * parse_short_name(const char *str, const struct ExpandoDefinition *defs, ExpandoParserFlags flags, struct ExpandoFormat *fmt, const char **parsed_until, struct ExpandoParseError *err)
Create an expando by its short name.
Definition: node_expando.c:244
@ MUTT_ASKNO
Ask the user, defaulting to 'No'.
Definition: quad.h:40
@ MUTT_NO
User answered 'No', or assume 'No'.
Definition: quad.h:38
@ MUTT_ASKYES
Ask the user, defaulting to 'Yes'.
Definition: quad.h:41
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition: quad.h:39
An email address.
Definition: address.h:36
String manipulation buffer.
Definition: buffer.h:36
Definition: set.h:62
const char * name
User-visible name.
Definition: set.h:63
Container for lots of config items.
Definition: set.h:248
Definition of a format string.
Definition: definition.h:44
Formatting information for an Expando.
Definition: node.h:53
Basic Expando Node.
Definition: node.h:67
int uid
Unique ID, e.g. ED_EMA_SIZE.
Definition: node.h:70
struct ExpandoFormat * format
Formatting info.
Definition: node.h:72
int(* render)(const struct ExpandoNode *node, const struct ExpandoRenderCallback *erc, struct Buffer *buf, int max_cols, void *data, MuttFormatFlags flags)
Definition: node.h:92
int did
Domain ID, e.g. ED_EMAIL.
Definition: node.h:69
const char * text
Node-specific text.
Definition: node.h:73
enum ExpandoNodeType type
Type of Node, e.g. ENT_EXPANDO.
Definition: node.h:68
Buffer for parsing errors.
Definition: parse.h:37
char message[1024]
Error message.
Definition: parse.h:38
const char * position
Position of error in original string.
Definition: parse.h:39
Parsed Expando trees.
Definition: expando.h:41
Mapping between user-readable string and a constant.
Definition: mapping.h:33
int value
Integer value.
Definition: mapping.h:35
Cached regular expression.
Definition: regex3.h:86
String list.
Definition: slist.h:37
#define D_SLIST_SEP_COMMA
Slist items are comma-separated.
Definition: types.h:110
#define D_CHARSET_SINGLE
Flag for charset_validator to allow only one charset.
Definition: types.h:83
#define D_SLIST_SEP_COLON
Slist items are colon-separated.
Definition: types.h:111
#define D_INTERNAL_DEPRECATED
Config item shouldn't be used any more.
Definition: types.h:87
#define D_STRING_COMMAND
A command.
Definition: types.h:98
#define D_SLIST_ALLOW_EMPTY
Slist may be empty.
Definition: types.h:115
#define D_L10N_STRING
String can be localised.
Definition: types.h:81
#define D_PATH_DIR
Path is a directory.
Definition: types.h:102
#define D_CHARSET_STRICT
Flag for charset_validator to use strict char check.
Definition: types.h:84
#define D_PATH_FILE
Path is a file.
Definition: types.h:103
@ DT_NUMBER
a number
Definition: types.h:38
@ DT_SLIST
a list of strings
Definition: types.h:42
@ DT_BOOL
boolean option
Definition: types.h:32
@ DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition: types.h:40
@ DT_SYNONYM
synonym for another variable
Definition: types.h:45
@ DT_STRING
a string
Definition: types.h:44
@ DT_SORT
sorting methods
Definition: types.h:43
@ DT_MBTABLE
multibyte char table
Definition: types.h:36
@ DT_ADDRESS
e-mail address
Definition: types.h:31
@ DT_EXPANDO
an expando
Definition: types.h:34
@ DT_ENUM
an enumeration
Definition: types.h:33
@ DT_REGEX
regular expressions
Definition: types.h:41
@ DT_PATH
a path to a file/directory
Definition: types.h:39
#define D_STRING_MAILBOX
Don't perform path expansions.
Definition: types.h:97
#define D_SORT_LAST
Sort flag for -last prefix.
Definition: types.h:118
#define D_SORT_REVERSE
Sort flag for -reverse prefix.
Definition: types.h:119
#define D_NOT_EMPTY
Empty strings are not allowed.
Definition: types.h:79
#define D_INTEGER_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:100
#define D_ON_STARTUP
May only be set at startup.
Definition: types.h:78
@ ED_GLO_PADDING_EOL
Padding to end-of-line.
Definition: uid.h:38
@ ED_GLO_PADDING_HARD
Hard Padding.
Definition: uid.h:39
@ ED_GLO_PADDING_SOFT
Soft Padding.
Definition: uid.h:40