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