NeoMutt  2024-04-25-76-g20fe7b
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 "menu/lib.h"
48#include "mixmaster/lib.h"
49#include "init.h"
50#include "mutt_logging.h"
51#include "mutt_thread.h"
52#include "mx.h"
53
54extern const struct ExpandoDefinition IndexFormatDef[];
55
56#define CONFIG_INIT_TYPE(CS, NAME) \
57 extern const struct ConfigSetType Cst##NAME; \
58 cs_register_type(CS, &Cst##NAME)
59
60#define CONFIG_INIT_VARS(CS, NAME) \
61 bool config_init_##NAME(struct ConfigSet *cs); \
62 config_init_##NAME(CS)
63
67static const struct Mapping SortAuxMethods[] = {
68 // clang-format off
69 { "date", SORT_DATE },
70 { "date-sent", SORT_DATE },
71 { "threads", SORT_DATE },
72 { "date-received", SORT_RECEIVED },
73 { "from", SORT_FROM },
74 { "label", SORT_LABEL },
75 { "unsorted", SORT_ORDER },
76 { "mailbox-order", SORT_ORDER },
77 { "score", SORT_SCORE },
78 { "size", SORT_SIZE },
79 { "spam", SORT_SPAM },
80 { "subject", SORT_SUBJECT },
81 { "to", SORT_TO },
82 { NULL, 0 },
83 // clang-format on
84};
85
89const struct Mapping SortMethods[] = {
90 // clang-format off
91 { "date", SORT_DATE },
92 { "date-sent", SORT_DATE },
93 { "date-received", SORT_RECEIVED },
94 { "from", SORT_FROM },
95 { "label", SORT_LABEL },
96 { "unsorted", SORT_ORDER },
97 { "mailbox-order", SORT_ORDER },
98 { "score", SORT_SCORE },
99 { "size", SORT_SIZE },
100 { "spam", SORT_SPAM },
101 { "subject", SORT_SUBJECT },
102 { "threads", SORT_THREADS },
103 { "to", SORT_TO },
104 { NULL, 0 },
105 // clang-format on
106};
107
111static int multipart_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef,
112 intptr_t value, struct Buffer *err)
113{
114 if (value == 0)
115 return CSR_SUCCESS;
116
117 const char *str = (const char *) value;
118
119 if (mutt_str_equal(str, "inline") || mutt_str_equal(str, "info"))
120 return CSR_SUCCESS;
121
122 buf_printf(err, _("Invalid value for option %s: %s"), cdef->name, str);
123 return CSR_ERR_INVALID;
124}
125
132static const struct ExpandoDefinition AttachFormatDef[] = {
133 // clang-format off
137 { "c", "charset-convert", ED_BODY, ED_BOD_CHARSET_CONVERT, E_TYPE_STRING, NULL },
138 { "C", "charset", ED_ATTACH, ED_ATT_CHARSET, E_TYPE_STRING, NULL },
139 { "d", "description", ED_BODY, ED_BOD_DESCRIPTION, E_TYPE_STRING, NULL },
140 { "D", "deleted", ED_BODY, ED_BOD_DELETED, E_TYPE_STRING, NULL },
141 { "e", "mime-encoding", ED_BODY, ED_BOD_MIME_ENCODING, E_TYPE_STRING, NULL },
142 { "f", "file", ED_BODY, ED_BOD_FILE, E_TYPE_STRING, NULL },
143 { "F", "file-disposition", ED_BODY, ED_BOD_FILE_DISPOSITION, E_TYPE_STRING, NULL },
144 { "I", "disposition", ED_BODY, ED_BOD_DISPOSITION, E_TYPE_STRING, NULL },
145 { "m", "mime-major", ED_BODY, ED_BOD_MIME_MAJOR, E_TYPE_STRING, NULL },
146 { "M", "mime-minor", ED_BODY, ED_BOD_MIME_MINOR, E_TYPE_STRING, NULL },
147 { "n", "number", ED_ATTACH, ED_ATT_NUMBER, E_TYPE_NUMBER, NULL },
148 { "Q", "attach-qualifies", ED_BODY, ED_BOD_ATTACH_QUALIFIES, E_TYPE_NUMBER, NULL },
149 { "s", "file-size", ED_BODY, ED_BOD_FILE_SIZE, E_TYPE_NUMBER, NULL },
150 { "t", "tagged", ED_BODY, ED_BOD_TAGGED, E_TYPE_STRING, NULL },
151 { "T", "tree", ED_ATTACH, ED_ATT_TREE, E_TYPE_STRING, NULL },
152 { "u", "unlink", ED_BODY, ED_BOD_UNLINK, E_TYPE_STRING, NULL },
153 { "X", "attach-count", ED_BODY, ED_BOD_ATTACH_COUNT, E_TYPE_NUMBER, NULL },
154 { NULL, NULL, 0, -1, -1, NULL }
155 // clang-format on
156};
157
164struct ExpandoNode *parse_index_date_recv_local(const char *str, const char **parsed_until,
165 int did, int uid, ExpandoParserFlags flags,
166 struct ExpandoParseError *error)
167{
168 if (flags & EP_CONDITIONAL)
169 {
170 return node_conddate_parse(str + 1, parsed_until, did, uid, error);
171 }
172
173 return node_expando_parse_enclosure(str, parsed_until, did, uid, ')', error);
174}
175
182struct ExpandoNode *parse_index_date_local(const char *str, const char **parsed_until,
183 int did, int uid, ExpandoParserFlags flags,
184 struct ExpandoParseError *error)
185{
186 if (flags & EP_CONDITIONAL)
187 {
188 return node_conddate_parse(str + 1, parsed_until, did, uid, error);
189 }
190
191 return node_expando_parse_enclosure(str, parsed_until, did, uid, ']', error);
192}
193
200struct ExpandoNode *parse_index_date(const char *str, const char **parsed_until,
201 int did, int uid, ExpandoParserFlags flags,
202 struct ExpandoParseError *error)
203{
204 if (flags & EP_CONDITIONAL)
205 {
206 return node_conddate_parse(str + 1, parsed_until, did, uid, error);
207 }
208
209 return node_expando_parse_enclosure(str, parsed_until, did, uid, '}', error);
210}
211
219struct ExpandoNode *parse_index_hook(const char *str, const char **parsed_until,
220 int did, int uid, ExpandoParserFlags flags,
221 struct ExpandoParseError *error)
222{
223 if (flags & EP_CONDITIONAL)
224 {
225 snprintf(error->message, sizeof(error->message),
226 _("index-hook cannot be used as a condition"));
227 error->position = str;
228 return NULL;
229 }
230
231 return node_expando_parse_enclosure(str, parsed_until, did, uid, '@', error);
232}
233
239struct ExpandoNode *parse_tags_transformed(const char *str, const char **parsed_until,
240 int did, int uid, ExpandoParserFlags flags,
241 struct ExpandoParseError *error)
242{
243 // Let the basic expando parser do the work
244 flags |= EP_NO_CUSTOM_PARSE;
245 struct ExpandoNode *node = node_expando_parse(str, parsed_until,
246 IndexFormatDef, flags, error);
247
248 // but adjust the node to take one more character
249 node->end++;
250 (*parsed_until)++;
251
252 return node;
253}
254
261struct ExpandoNode *parse_subject(const char *str, const char **parsed_until,
262 int did, int uid, ExpandoParserFlags flags,
263 struct ExpandoParseError *error)
264{
265 // Let the basic expando parser do the work
266 flags |= EP_NO_CUSTOM_PARSE;
267 struct ExpandoNode *node_subj = node_expando_parse(str, parsed_until,
268 IndexFormatDef, flags, error);
269
270 struct ExpandoNode *node_tree = node_expando_new(node_subj->start, node_subj->end,
272 node_tree->next = node_subj;
273
274 // Move the formatting info to the container
275 struct ExpandoNode *node_cont = node_container_new();
276 node_cont->format = node_subj->format;
277 node_subj->format = NULL;
278
279 ARRAY_ADD(&node_cont->children, node_tree);
280 return node_cont;
281}
282
297 // clang-format off
303 { "a", "from", ED_ENVELOPE, ED_ENV_FROM, E_TYPE_STRING, NULL },
304 { "A", "reply-to", ED_ENVELOPE, ED_ENV_REPLY_TO, E_TYPE_STRING, NULL },
305 { "b", "mailbox-name", ED_MAILBOX, ED_MBX_MAILBOX_NAME, E_TYPE_STRING, NULL },
306 { "B", "list-address", ED_ENVELOPE, ED_ENV_LIST_ADDRESS, E_TYPE_STRING, NULL },
307 { "c", "size", ED_EMAIL, ED_EMA_SIZE, E_TYPE_STRING, NULL },
308 { "C", "number", ED_EMAIL, ED_EMA_NUMBER, E_TYPE_NUMBER, NULL },
309 { "cr", "body-characters", ED_EMAIL, ED_EMA_BODY_CHARACTERS, E_TYPE_NUMBER, NULL },
310 { "d", "date-format", ED_EMAIL, ED_EMA_DATE_FORMAT, E_TYPE_STRING, NULL },
311 { "D", "date-format-local", ED_EMAIL, ED_EMA_DATE_FORMAT_LOCAL, E_TYPE_STRING, NULL },
312 { "e", "thread-number", ED_EMAIL, ED_EMA_THREAD_NUMBER, E_TYPE_NUMBER, NULL },
313 { "E", "thread-count", ED_EMAIL, ED_EMA_THREAD_COUNT, E_TYPE_NUMBER, NULL },
314 { "f", "from-full", ED_ENVELOPE, ED_ENV_FROM_FULL, E_TYPE_STRING, NULL },
315 { "F", "sender", ED_ENVELOPE, ED_ENV_SENDER, E_TYPE_STRING, NULL },
316 { "Fp", "sender-plain", ED_ENVELOPE, ED_ENV_SENDER_PLAIN, E_TYPE_STRING, NULL },
317 { "g", "tags", ED_EMAIL, ED_EMA_TAGS, E_TYPE_STRING, NULL },
319 { "H", "spam", ED_ENVELOPE, ED_ENV_SPAM, E_TYPE_STRING, NULL },
320 { "i", "message-id", ED_ENVELOPE, ED_ENV_MESSAGE_ID, E_TYPE_STRING, NULL },
321 { "I", "initials", ED_ENVELOPE, ED_ENV_INITIALS, E_TYPE_STRING, NULL },
322 { "J", "thread-tags", ED_EMAIL, ED_EMA_THREAD_TAGS, E_TYPE_STRING, NULL },
323 { "K", "list-empty", ED_ENVELOPE, ED_ENV_LIST_EMPTY, E_TYPE_STRING, NULL },
324 { "l", "lines", ED_EMAIL, ED_EMA_LINES, E_TYPE_NUMBER, NULL },
325 { "L", "from-list", ED_EMAIL, ED_EMA_FROM_LIST, E_TYPE_STRING, NULL },
326 { "m", "message-count", ED_MAILBOX, ED_MBX_MESSAGE_COUNT, E_TYPE_NUMBER, NULL },
327 { "M", "thread-hidden-count", ED_EMAIL, ED_EMA_THREAD_HIDDEN_COUNT, E_TYPE_NUMBER, NULL },
328 { "n", "name", ED_ENVELOPE, ED_ENV_NAME, E_TYPE_STRING, NULL },
329 { "N", "score", ED_EMAIL, ED_EMA_SCORE, E_TYPE_NUMBER, NULL },
330 { "O", "save-folder", ED_EMAIL, ED_EMA_LIST_OR_SAVE_FOLDER, E_TYPE_STRING, NULL },
331 { "P", "percentage", ED_MAILBOX, ED_MBX_PERCENTAGE, E_TYPE_STRING, NULL },
332 { "q", "newsgroup", ED_ENVELOPE, ED_ENV_NEWSGROUP, E_TYPE_STRING, NULL },
333 { "r", "to-all", ED_ENVELOPE, ED_ENV_TO_ALL, E_TYPE_STRING, NULL },
334 { "R", "cc-all", ED_ENVELOPE, ED_ENV_CC_ALL, E_TYPE_STRING, NULL },
336 { "S", "flag-chars", ED_EMAIL, ED_EMA_FLAG_CHARS, E_TYPE_STRING, NULL },
337 { "t", "to", ED_ENVELOPE, ED_ENV_TO, E_TYPE_STRING, NULL },
338 { "T", "to-chars", ED_EMAIL, ED_EMA_TO_CHARS, E_TYPE_STRING, NULL },
339 { "u", "username", ED_ENVELOPE, ED_ENV_USERNAME, E_TYPE_STRING, NULL },
340 { "v", "first-name", ED_ENVELOPE, ED_ENV_FIRST_NAME, E_TYPE_STRING, NULL },
341 { "W", "organization", ED_ENVELOPE, ED_ENV_ORGANIZATION, E_TYPE_STRING, NULL },
342 { "x", "x-comment-to", ED_ENVELOPE, ED_ENV_X_COMMENT_TO, E_TYPE_STRING, NULL },
343 { "X", "attachment-count", ED_EMAIL, ED_EMA_ATTACHMENT_COUNT, E_TYPE_NUMBER, NULL },
344 { "y", "x-label", ED_ENVELOPE, ED_ENV_X_LABEL, E_TYPE_STRING, NULL },
345 { "Y", "thread-x-label", ED_ENVELOPE, ED_ENV_THREAD_X_LABEL, E_TYPE_STRING, NULL },
346 { "Z", "combined-flags", ED_EMAIL, ED_EMA_COMBINED_FLAGS, E_TYPE_STRING, NULL },
347 { "zc", "crypto-flags", ED_EMAIL, ED_EMA_CRYPTO_FLAGS, E_TYPE_STRING, NULL },
348 { "zs", "status-flags", ED_EMAIL, ED_EMA_STATUS_FLAGS, E_TYPE_STRING, NULL },
349 { "zt", "message-flags", ED_EMAIL, ED_EMA_MESSAGE_FLAGS, E_TYPE_STRING, NULL },
352 { NULL, NULL, 0, -1, -1, NULL }
353 // clang-format on
354};
355
358
368static const struct ExpandoDefinition StatusFormatDef[] = {
369 // clang-format off
373 { "b", "unread-mailboxes", ED_INDEX, ED_IND_UNREAD_MAILBOXES, E_TYPE_NUMBER, NULL },
374 { "d", "deleted-count", ED_INDEX, ED_IND_DELETED_COUNT, E_TYPE_NUMBER, NULL },
375 { "D", "description", ED_INDEX, ED_IND_DESCRIPTION, E_TYPE_STRING, NULL },
376 { "f", "mailbox-path", ED_INDEX, ED_IND_MAILBOX_PATH, E_TYPE_STRING, NULL },
377 { "F", "flagged-count", ED_INDEX, ED_IND_FLAGGED_COUNT, E_TYPE_NUMBER, NULL },
378 { "h", "hostname", ED_GLOBAL, ED_GLO_HOSTNAME, E_TYPE_STRING, NULL },
379 { "l", "mailbox-size", ED_INDEX, ED_IND_MAILBOX_SIZE, E_TYPE_NUMBER, NULL },
380 { "L", "limit-size", ED_INDEX, ED_IND_LIMIT_SIZE, E_TYPE_NUMBER, NULL },
381 { "m", "message-count", ED_INDEX, ED_IND_MESSAGE_COUNT, E_TYPE_NUMBER, NULL },
382 { "M", "limit-count", ED_INDEX, ED_IND_LIMIT_COUNT, E_TYPE_NUMBER, NULL },
383 { "n", "new-count", ED_INDEX, ED_IND_NEW_COUNT, E_TYPE_NUMBER, NULL },
384 { "o", "old-count", ED_INDEX, ED_IND_OLD_COUNT, E_TYPE_NUMBER, NULL },
385 { "p", "postponed-count", ED_INDEX, ED_IND_POSTPONED_COUNT, E_TYPE_NUMBER, NULL },
386 { "P", "percentage", ED_MENU, ED_MEN_PERCENTAGE, E_TYPE_NUMBER, NULL },
387 { "r", "readonly", ED_INDEX, ED_IND_READONLY, E_TYPE_NUMBER, NULL },
388 { "R", "read-count", ED_INDEX, ED_IND_READ_COUNT, E_TYPE_NUMBER, NULL },
389 { "s", "sort", ED_GLOBAL, ED_GLO_SORT, E_TYPE_STRING, NULL },
390 { "S", "sort-aux", ED_GLOBAL, ED_GLO_SORT_AUX, E_TYPE_STRING, NULL },
391 { "t", "tagged-count", ED_INDEX, ED_IND_TAGGED_COUNT, E_TYPE_NUMBER, NULL },
392 { "T", "use-threads", ED_GLOBAL, ED_GLO_USE_THREADS, E_TYPE_STRING, NULL },
393 { "u", "unread-count", ED_INDEX, ED_IND_UNREAD_COUNT, E_TYPE_NUMBER, NULL },
394 { "v", "version", ED_GLOBAL, ED_GLO_VERSION, E_TYPE_STRING, NULL },
395 { "V", "limit-pattern", ED_INDEX, ED_IND_LIMIT_PATTERN, E_TYPE_STRING, NULL },
396 { NULL, NULL, 0, -1, -1, NULL }
397 // clang-format on
398};
399
402
406static struct ConfigDef MainVars[] = {
407 // clang-format off
408 { "abort_backspace", DT_BOOL, true, 0, NULL,
409 "Hitting backspace against an empty prompt aborts the prompt"
410 },
411 { "abort_key", DT_STRING|D_NOT_EMPTY|D_ON_STARTUP, IP "\007", 0, NULL,
412 "String representation of key to abort prompts"
413 },
414 { "arrow_cursor", DT_BOOL, false, 0, NULL,
415 "Use an arrow '->' instead of highlighting in the index"
416 },
417 { "arrow_string", DT_STRING|D_NOT_EMPTY, IP "->", 0, NULL,
418 "Use a custom string for arrow_cursor"
419 },
420 { "ascii_chars", DT_BOOL, false, 0, NULL,
421 "Use plain ASCII characters, when drawing email threads"
422 },
424 "If a message is missing a character set, assume this character set"
425 },
426 { "attach_format", DT_EXPANDO|D_NOT_EMPTY, IP "%u%D%I %t%4n %T%d %> [%.7m/%.10M, %.6e%<C?, %C>, %s] ", IP &AttachFormatDef, NULL,
427 "printf-like format string for the attachment menu"
428 },
429 { "attach_save_dir", DT_PATH|D_PATH_DIR, IP "./", 0, NULL,
430 "Default directory where attachments are saved"
431 },
432 { "attach_save_without_prompting", DT_BOOL, false, 0, NULL,
433 "If true, then don't prompt to save"
434 },
435 { "attach_sep", DT_STRING, IP "\n", 0, NULL,
436 "Separator to add between saved/printed/piped attachments"
437 },
438 { "attach_split", DT_BOOL, true, 0, NULL,
439 "Save/print/pipe tagged messages individually"
440 },
441 { "auto_edit", DT_BOOL, false, 0, NULL,
442 "Skip the initial compose menu and edit the email"
443 },
444 { "auto_subscribe", DT_BOOL, false, 0, NULL,
445 "Automatically check if the user is subscribed to a mailing list"
446 },
447 { "auto_tag", DT_BOOL, false, 0, NULL,
448 "Automatically apply actions to all tagged messages"
449 },
450 { "beep", DT_BOOL, true, 0, NULL,
451 "Make a noise when an error occurs"
452 },
453 { "beep_new", DT_BOOL, false, 0, NULL,
454 "Make a noise when new mail arrives"
455 },
456 { "bounce", DT_QUAD, MUTT_ASKYES, 0, NULL,
457 "Confirm before bouncing a message"
458 },
459 { "braille_friendly", DT_BOOL, false, 0, NULL,
460 "Move the cursor to the beginning of the line"
461 },
463 "Default character set for displaying text on screen"
464 },
465 { "collapse_flagged", DT_BOOL, true, 0, NULL,
466 "Prevent the collapse of threads with flagged emails"
467 },
468 { "collapse_unread", DT_BOOL, true, 0, NULL,
469 "Prevent the collapse of threads with unread emails"
470 },
471 { "color_directcolor", DT_BOOL|D_ON_STARTUP, false, 0, NULL,
472 "Use 24bit colors (aka truecolor aka directcolor)"
473 },
474 { "config_charset", DT_STRING, 0, 0, charset_validator,
475 "Character set that the config files are in"
476 },
477 { "confirm_append", DT_BOOL, true, 0, NULL,
478 "Confirm before appending emails to a mailbox"
479 },
480 { "confirm_create", DT_BOOL, true, 0, NULL,
481 "Confirm before creating a new mailbox"
482 },
483 { "copy_decode_weed", DT_BOOL, false, 0, NULL,
484 "Controls whether to weed headers when copying or saving emails"
485 },
486 { "count_alternatives", DT_BOOL, false, 0, NULL,
487 "Recurse inside multipart/alternatives while counting attachments"
488 },
489 { "crypt_chars", DT_MBTABLE, IP "SPsK ", 0, NULL,
490 "User-configurable crypto flags: signed, encrypted etc."
491 },
492 { "date_format", DT_STRING|D_NOT_EMPTY, IP "!%a, %b %d, %Y at %I:%M:%S%p %Z", 0, NULL,
493 "strftime format string for the `%d` expando"
494 },
495 { "debug_file", DT_PATH|D_PATH_FILE, IP "~/.neomuttdebug", 0, NULL,
496 "File to save debug logs"
497 },
498 { "debug_level", DT_NUMBER, 0, 0, level_validator,
499 "Logging level for debug logs"
500 },
501 { "default_hook", DT_STRING, IP "~f %s !~P | (~P ~C %s)", 0, NULL,
502 "Pattern to use for hooks that only have a simple regex"
503 },
504 { "delete", DT_QUAD, MUTT_ASKYES, 0, NULL,
505 "Really delete messages, when the mailbox is closed"
506 },
507 { "delete_untag", DT_BOOL, true, 0, NULL,
508 "Untag messages when they are marked for deletion"
509 },
510 { "digest_collapse", DT_BOOL, true, 0, NULL,
511 "Hide the subparts of a multipart/digest"
512 },
513 { "duplicate_threads", DT_BOOL, true, 0, NULL,
514 "Highlight messages with duplicated message IDs"
515 },
516 { "editor", DT_STRING|D_NOT_EMPTY|D_STRING_COMMAND, 0, 0, NULL,
517 "External command to use as an email editor"
518 },
519 { "flag_chars", DT_MBTABLE, IP "*!DdrONon- ", 0, NULL,
520 "User-configurable index flags: tagged, new, etc"
521 },
522 { "flag_safe", DT_BOOL, false, 0, NULL,
523 "Protect flagged messages from deletion"
524 },
525 { "folder", DT_STRING|D_STRING_MAILBOX, IP "~/Mail", 0, NULL,
526 "Base folder for a set of mailboxes"
527 },
528 { "force_name", DT_BOOL, false, 0, NULL,
529 "Save outgoing mail in a folder of their name"
530 },
531 { "forward_decode", DT_BOOL, true, 0, NULL,
532 "Decode the message when forwarding it"
533 },
534 { "forward_quote", DT_BOOL, false, 0, NULL,
535 "Automatically quote a forwarded message using `$indent_string`"
536 },
537 { "from", DT_ADDRESS, 0, 0, NULL,
538 "Default 'From' address to use, if isn't otherwise set"
539 },
540 { "from_chars", DT_MBTABLE, 0, 0, NULL,
541 "User-configurable index flags: to address, cc address, etc"
542 },
543 { "gecos_mask", DT_REGEX, IP "^[^,]*", 0, NULL,
544 "Regex for parsing GECOS field of /etc/passwd"
545 },
546 { "header", DT_BOOL, false, 0, NULL,
547 "Include the message headers in the reply email (Weed applies)"
548 },
549 { "hidden_tags", DT_SLIST|D_SLIST_SEP_COMMA, IP "unread,draft,flagged,passed,replied,attachment,signed,encrypted", 0, NULL,
550 "List of tags that shouldn't be displayed on screen (comma-separated)"
551 },
552 { "hide_limited", DT_BOOL, false, 0, NULL,
553 "Don't indicate hidden messages, in the thread tree"
554 },
555 { "hide_missing", DT_BOOL, true, 0, NULL,
556 "Don't indicate missing messages, in the thread tree"
557 },
558 { "hide_thread_subject", DT_BOOL, true, 0, NULL,
559 "Hide subjects that are similar to that of the parent message"
560 },
561 { "hide_top_limited", DT_BOOL, false, 0, NULL,
562 "Don't indicate hidden top message, in the thread tree"
563 },
564 { "hide_top_missing", DT_BOOL, true, 0, NULL,
565 "Don't indicate missing top message, in the thread tree"
566 },
567 { "honor_disposition", DT_BOOL, false, 0, NULL,
568 "Don't display MIME parts inline if they have a disposition of 'attachment'"
569 },
570 { "hostname", DT_STRING, 0, 0, NULL,
571 "Fully-qualified domain name of this machine"
572 },
573 { "implicit_auto_view", DT_BOOL, false, 0, NULL,
574 "Display MIME attachments inline if a 'copiousoutput' mailcap entry exists"
575 },
576 { "include_encrypted", DT_BOOL, false, 0, NULL,
577 "Whether to include encrypted content when replying"
578 },
579 { "include_only_first", DT_BOOL, false, 0, NULL,
580 "Only include the first attachment when replying"
581 },
582 { "indent_string", DT_EXPANDO, IP "> ", IP IndexFormatDefNoPadding, NULL,
583 "String used to indent 'reply' text"
584 },
585 { "index_format", DT_EXPANDO|D_NOT_EMPTY, IP "%4C %Z %{%b %d} %-15.15L (%<l?%4l&%4c>) %s", IP &IndexFormatDef, NULL,
586 "printf-like format string for the index menu (emails)"
587 },
588 { "keep_flagged", DT_BOOL, false, 0, NULL,
589 "Don't move flagged messages from `$spool_file` to `$mbox`"
590 },
591 { "local_date_header", DT_BOOL, true, 0, NULL,
592 "Convert the date in the Date header of sent emails into local timezone, UTC otherwise"
593 },
594 { "mail_check", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 5, 0, NULL,
595 "Number of seconds before NeoMutt checks for new mail"
596 },
597 { "mail_check_recent", DT_BOOL, true, 0, NULL,
598 "Notify the user about new mail since the last time the mailbox was opened"
599 },
600 { "mail_check_stats", DT_BOOL, false, 0, NULL,
601 "Periodically check for new mail"
602 },
603 { "mail_check_stats_interval", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 60, 0, NULL,
604 "How often to check for new mail"
605 },
606 { "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,
607 "List of mailcap files (colon-separated)"
608 },
609 { "mailcap_sanitize", DT_BOOL, true, 0, NULL,
610 "Restrict the possible characters in mailcap expandos"
611 },
612 { "mark_old", DT_BOOL, true, 0, NULL,
613 "Mark new emails as old when leaving the mailbox"
614 },
615 { "markers", DT_BOOL, true, 0, NULL,
616 "Display a '+' at the beginning of wrapped lines in the pager"
617 },
618 { "mbox", DT_STRING|D_STRING_MAILBOX, IP "~/mbox", 0, NULL,
619 "Folder that receives read emails (see Move)"
620 },
621 { "mbox_type", DT_ENUM, MUTT_MBOX, IP &MboxTypeDef, NULL,
622 "Default type for creating new mailboxes"
623 },
624 { "message_cache_clean", DT_BOOL, false, 0, NULL,
625 "(imap/pop) Clean out obsolete entries from the message cache"
626 },
627 { "message_cache_dir", DT_PATH|D_PATH_DIR, 0, 0, NULL,
628 "(imap/pop) Directory for the message cache"
629 },
630 { "message_format", DT_EXPANDO|D_NOT_EMPTY, IP "%s", IP &IndexFormatDef, NULL,
631 "printf-like format string for listing attached messages"
632 },
633 { "meta_key", DT_BOOL, false, 0, NULL,
634 "Interpret 'ALT-x' as 'ESC-x'"
635 },
636 { "mime_forward", DT_QUAD, MUTT_NO, 0, NULL,
637 "Forward a message as a 'message/RFC822' MIME part"
638 },
639 { "mime_forward_rest", DT_QUAD, MUTT_YES, 0, NULL,
640 "Forward all attachments, even if they can't be decoded"
641 },
642 { "move", DT_QUAD, MUTT_NO, 0, NULL,
643 "Move emails from `$spool_file` to `$mbox` when read"
644 },
645 { "narrow_tree", DT_BOOL, false, 0, NULL,
646 "Draw a narrower thread tree in the index"
647 },
648 { "net_inc", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 10, 0, NULL,
649 "(socket) Update the progress bar after this many KB sent/received (0 to disable)"
650 },
651 { "new_mail_command", DT_EXPANDO|D_STRING_COMMAND, 0, IP StatusFormatDefNoPadding, NULL,
652 "External command to run when new mail arrives"
653 },
654 { "pipe_decode", DT_BOOL, false, 0, NULL,
655 "Decode the message when piping it"
656 },
657 { "pipe_decode_weed", DT_BOOL, true, 0, NULL,
658 "Control whether to weed headers when piping an email"
659 },
660 { "pipe_sep", DT_STRING, IP "\n", 0, NULL,
661 "Separator to add between multiple piped messages"
662 },
663 { "pipe_split", DT_BOOL, false, 0, NULL,
664 "Run the pipe command on each message separately"
665 },
666 { "postponed", DT_STRING|D_STRING_MAILBOX, IP "~/postponed", 0, NULL,
667 "Folder to store postponed messages"
668 },
669 { "preferred_languages", DT_SLIST|D_SLIST_SEP_COMMA, 0, 0, NULL,
670 "List of Preferred Languages for multilingual MIME (comma-separated)"
671 },
672 { "print", DT_QUAD, MUTT_ASKNO, 0, NULL,
673 "Confirm before printing a message"
674 },
675 { "print_command", DT_STRING|D_STRING_COMMAND, IP "lpr", 0, NULL,
676 "External command to print a message"
677 },
678 { "print_decode", DT_BOOL, true, 0, NULL,
679 "Decode message before printing it"
680 },
681 { "print_decode_weed", DT_BOOL, true, 0, NULL,
682 "Control whether to weed headers when printing an email"
683 },
684 { "print_split", DT_BOOL, false, 0, NULL,
685 "Print multiple messages separately"
686 },
687 { "quit", DT_QUAD, MUTT_YES, 0, NULL,
688 "Prompt before exiting NeoMutt"
689 },
690 { "quote_regex", DT_REGEX, IP "^([ \t]*[|>:}#])+", 0, NULL,
691 "Regex to match quoted text in a reply"
692 },
693 { "read_inc", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 10, 0, NULL,
694 "Update the progress bar after this many records read (0 to disable)"
695 },
696 { "read_only", DT_BOOL, false, 0, NULL,
697 "Open folders in read-only mode"
698 },
699 { "real_name", DT_STRING, 0, 0, NULL,
700 "Real name of the user"
701 },
702 { "record", DT_STRING|D_STRING_MAILBOX, IP "~/sent", 0, NULL,
703 "Folder to save 'sent' messages"
704 },
705 { "reflow_space_quotes", DT_BOOL, true, 0, NULL,
706 "Insert spaces into reply quotes for 'format=flowed' messages"
707 },
708 { "reflow_text", DT_BOOL, true, 0, NULL,
709 "Reformat paragraphs of 'format=flowed' text"
710 },
711 { "reflow_wrap", DT_NUMBER, 78, 0, NULL,
712 "Maximum paragraph width for reformatting 'format=flowed' text"
713 },
714 // L10N: $reply_regex default format
715 //
716 // This is a regular expression that matches reply subject lines.
717 // By default, it only matches an initial "Re: ", which is the
718 // standardized Latin prefix.
719 //
720 // However, many locales have other prefixes that are commonly used
721 // too, such as Aw in Germany. To add other prefixes, modify the first
722 // parenthesized expression, such as:
723 // "^(re|aw)
724 // you can add multiple values, for example:
725 // "^(re|aw|sv)
726 //
727 // Important:
728 // - Use all lower case letters.
729 // - Don't remove the 're' prefix from the list of choices.
730 // - Please test the value you use inside Mutt. A mistake here will break
731 // NeoMutt's threading behavior. Note: the header cache can interfere with
732 // testing, so be sure to test with $header_cache unset.
733 { "reply_regex", DT_REGEX|D_L10N_STRING, IP N_("^((re)(\\[[0-9]+\\])*:[ \t]*)*"), 0, NULL,
734 "Regex to match message reply subjects like 're: '"
735 },
736 { "resolve", DT_BOOL, true, 0, NULL,
737 "Move to the next email whenever a command modifies an email"
738 },
739 { "resume_edited_draft_files", DT_BOOL, true, 0, NULL,
740 "Resume editing previously saved draft files"
741 },
742 { "reverse_alias", DT_BOOL, false, 0, NULL,
743 "Display the alias in the index, rather than the message's sender"
744 },
745 { "rfc2047_parameters", DT_BOOL, true, 0, NULL,
746 "Decode RFC2047-encoded MIME parameters"
747 },
748 { "save_address", DT_BOOL, false, 0, NULL,
749 "Use sender's full address as a default save folder"
750 },
751 { "save_empty", DT_BOOL, true, 0, NULL,
752 "(mbox,mmdf) Preserve empty mailboxes"
753 },
754 { "save_name", DT_BOOL, false, 0, NULL,
755 "Save outgoing message to mailbox of recipient's name if it exists"
756 },
757 { "score", DT_BOOL, true, 0, NULL,
758 "Use message scoring"
759 },
760 { "score_threshold_delete", DT_NUMBER, -1, 0, NULL,
761 "Messages with a lower score will be automatically deleted"
762 },
763 { "score_threshold_flag", DT_NUMBER, 9999, 0, NULL,
764 "Messages with a greater score will be automatically flagged"
765 },
766 { "score_threshold_read", DT_NUMBER, -1, 0, NULL,
767 "Messages with a lower score will be automatically marked read"
768 },
769 { "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,
770 "Character sets for outgoing mail"
771 },
772 { "shell", DT_STRING|D_STRING_COMMAND, IP "/bin/sh", 0, NULL,
773 "External command to run subshells in"
774 },
775 { "show_multipart_alternative", DT_STRING, 0, 0, multipart_validator,
776 "How to display 'multipart/alternative' MIME parts"
777 },
778 { "simple_search", DT_STRING, IP "~f %s | ~s %s", 0, NULL,
779 "Pattern to search for when search doesn't contain ~'s"
780 },
781 { "size_show_bytes", DT_BOOL, false, 0, NULL,
782 "Show smaller sizes in bytes"
783 },
784 { "size_show_fractions", DT_BOOL, true, 0, NULL,
785 "Show size fractions with a single decimal place"
786 },
787 { "size_show_mb", DT_BOOL, true, 0, NULL,
788 "Show sizes in megabytes for sizes greater than 1 megabyte"
789 },
790 { "size_units_on_left", DT_BOOL, false, 0, NULL,
791 "Show the units as a prefix to the size"
792 },
793 { "sleep_time", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 1, 0, NULL,
794 "Time to pause after certain info messages"
795 },
797 "Sort method for the index"
798 },
800 "Secondary sort method for the index"
801 },
802 { "sort_re", DT_BOOL, true, 0, NULL,
803 "Whether $reply_regex must be matched when not $strict_threads"
804 },
805 { "spam_separator", DT_STRING, IP ",", 0, NULL,
806 "Separator for multiple spam headers"
807 },
808 { "spool_file", DT_STRING|D_STRING_MAILBOX, 0, 0, NULL,
809 "Inbox"
810 },
811 { "status_chars", DT_MBTABLE, IP "-*%A", 0, NULL,
812 "Indicator characters for the status bar"
813 },
814 // L10N: $status_format default format
815 { "status_format", DT_EXPANDO|D_L10N_STRING, IP N_("-%r-NeoMutt: %D [Msgs:%<M?%M/>%m%<n? New:%n>%<o? Old:%o>%<d? Del:%d>%<F? Flag:%F>%<t? Tag:%t>%<p? Post:%p>%<b? Inc:%b>%<l? %l>]---(%<T?%T/>%s/%S)-%>-(%P)---"), IP &StatusFormatDef, NULL,
816 "printf-like format string for the index's status line"
817 },
818 { "status_on_top", DT_BOOL, false, 0, NULL,
819 "Display the status bar at the top"
820 },
821 { "strict_threads", DT_BOOL, false, 0, NULL,
822 "Thread messages using 'In-Reply-To' and 'References' headers"
823 },
824 { "suspend", DT_BOOL, true, 0, NULL,
825 "Allow the user to suspend NeoMutt using '^Z'"
826 },
827 { "text_flowed", DT_BOOL, false, 0, NULL,
828 "Generate 'format=flowed' messages"
829 },
830 { "thread_received", DT_BOOL, false, 0, NULL,
831 "Sort threaded messages by their received date"
832 },
833 { "time_inc", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 0, 0, NULL,
834 "Frequency of progress bar updates (milliseconds)"
835 },
836 { "timeout", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 600, 0, NULL,
837 "Time to wait for user input in menus"
838 },
839 { "tmp_dir", DT_PATH|D_PATH_DIR|D_NOT_EMPTY, IP TMPDIR, 0, NULL,
840 "Directory for temporary files"
841 },
842 { "to_chars", DT_MBTABLE, IP " +TCFLR", 0, NULL,
843 "Indicator characters for the 'To' field in the index"
844 },
845 { "trash", DT_STRING|D_STRING_MAILBOX, 0, 0, NULL,
846 "Folder to put deleted emails"
847 },
848 { "ts_enabled", DT_BOOL, false, 0, NULL,
849 "Allow NeoMutt to set the terminal status line and icon"
850 },
851 // L10N: $ts_icon_format default format
852 { "ts_icon_format", DT_EXPANDO|D_L10N_STRING, IP N_("M%<n?AIL&ail>"), IP StatusFormatDefNoPadding, NULL,
853 "printf-like format string for the terminal's icon title"
854 },
855 // L10N: $ts_status_format default format
856 { "ts_status_format", DT_EXPANDO|D_L10N_STRING, IP N_("NeoMutt with %<m?%m messages&no messages>%<n? [%n NEW]>"), IP StatusFormatDefNoPadding, NULL,
857 "printf-like format string for the terminal's status (window title)"
858 },
859 { "use_domain", DT_BOOL, true, 0, NULL,
860 "Qualify local addresses using this domain"
861 },
862 { "use_threads", DT_ENUM, UT_UNSET, IP &UseThreadsTypeDef, NULL,
863 "Whether to use threads for the index"
864 },
865 { "wait_key", DT_BOOL, true, 0, NULL,
866 "Prompt to press a key after running external commands"
867 },
868 { "weed", DT_BOOL, true, 0, NULL,
869 "Filter headers when displaying/forwarding/printing/replying"
870 },
871 { "wrap", DT_NUMBER, 0, 0, NULL,
872 "Width to wrap text in the pager"
873 },
874 { "wrap_search", DT_BOOL, true, 0, NULL,
875 "Wrap around when the search hits the end"
876 },
877 { "write_inc", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 10, 0, NULL,
878 "Update the progress bar after this many records written (0 to disable)"
879 },
880
881 { "cursor_overlay", D_INTERNAL_DEPRECATED|DT_BOOL, 0, IP "2020-07-20" },
882 { "escape", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2021-03-18" },
883 { "ignore_linear_white_space", D_INTERNAL_DEPRECATED|DT_BOOL, 0, IP "2021-03-18" },
884 { "visual", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2021-03-18" },
885
886 { "autoedit", DT_SYNONYM, IP "auto_edit", IP "2021-03-21" },
887 { "confirmappend", DT_SYNONYM, IP "confirm_append", IP "2021-03-21" },
888 { "confirmcreate", DT_SYNONYM, IP "confirm_create", IP "2021-03-21" },
889 { "edit_hdrs", DT_SYNONYM, IP "edit_headers", IP "2021-03-21" },
890 { "forw_decode", DT_SYNONYM, IP "forward_decode", IP "2021-03-21" },
891 { "forw_quote", DT_SYNONYM, IP "forward_quote", IP "2021-03-21" },
892 { "hdr_format", DT_SYNONYM, IP "index_format", IP "2021-03-21" },
893 { "implicit_autoview", DT_SYNONYM, IP "implicit_auto_view", IP "2023-01-25" },
894 { "include_onlyfirst", DT_SYNONYM, IP "include_only_first", IP "2021-03-21" },
895 { "indent_str", DT_SYNONYM, IP "indent_string", IP "2021-03-21" },
896 { "message_cachedir", DT_SYNONYM, IP "message_cache_dir", IP "2023-01-25" },
897 { "mime_fwd", DT_SYNONYM, IP "mime_forward", IP "2021-03-21" },
898 { "msg_format", DT_SYNONYM, IP "message_format", IP "2021-03-21" },
899 { "print_cmd", DT_SYNONYM, IP "print_command", IP "2021-03-21" },
900 { "quote_regexp", DT_SYNONYM, IP "quote_regex", IP "2021-03-21" },
901 { "realname", DT_SYNONYM, IP "real_name", IP "2021-03-21" },
902 { "reply_regexp", DT_SYNONYM, IP "reply_regex", IP "2021-03-21" },
903 { "spoolfile", DT_SYNONYM, IP "spool_file", IP "2021-03-21" },
904 { "tmpdir", DT_SYNONYM, IP "tmp_dir", IP "2023-01-25" },
905 { "xterm_icon", DT_SYNONYM, IP "ts_icon_format", IP "2021-03-21" },
906 { "xterm_set_titles", DT_SYNONYM, IP "ts_enabled", IP "2021-03-21" },
907 { "xterm_title", DT_SYNONYM, IP "ts_status_format", IP "2021-03-21" },
908
909 { "devel_security", DT_BOOL, false, 0, NULL,
910 "Devel feature: Security -- https://github.com/neomutt/neomutt/discussions/4251"
911 },
912
913 { NULL },
914 // clang-format on
915};
916
917#if defined(MIXMASTER)
918#ifdef MIXMASTER
919#define MIXMASTER_DEFAULT MIXMASTER
920#else
921#define MIXMASTER_DEFAULT ""
922#endif
923
930static const struct ExpandoDefinition MixFormatDef[] = {
931 // clang-format off
935 { "a", "address", ED_MIXMASTER, ED_MIX_ADDRESS, E_TYPE_STRING, NULL },
936 { "c", "capabilities", ED_MIXMASTER, ED_MIX_CAPABILITIES, E_TYPE_STRING, NULL },
937 { "n", "number", ED_MIXMASTER, ED_MIX_NUMBER, E_TYPE_NUMBER, NULL },
938 { "s", "short-name", ED_MIXMASTER, ED_MIX_SHORT_NAME, E_TYPE_STRING, NULL },
939 { NULL, NULL, 0, -1, -1, NULL }
940 // clang-format on
941};
942
946static struct ConfigDef MainVarsMixmaster[] = {
947 // clang-format off
948 { "mix_entry_format", DT_EXPANDO|D_NOT_EMPTY, IP "%4n %c %-16s %a", IP &MixFormatDef, NULL,
949 "(mixmaster) printf-like format string for the mixmaster chain"
950 },
951 { "mixmaster", DT_STRING|D_STRING_COMMAND, IP MIXMASTER_DEFAULT, 0, NULL,
952 "(mixmaster) External command to route a mixmaster message"
953 },
954 { NULL },
955 // clang-format on
956};
957#endif
958
959#if defined(HAVE_LIBIDN)
963static struct ConfigDef MainVarsIdn[] = {
964 // clang-format off
965 { "idn_decode", DT_BOOL, true, 0, NULL,
966 "(idn) Decode international domain names"
967 },
968 { "idn_encode", DT_BOOL, true, 0, NULL,
969 "(idn) Encode international domain names"
970 },
971 { NULL },
972 // clang-format on
973};
974#endif
975
979static bool config_init_main(struct ConfigSet *cs)
980{
981 bool rc = cs_register_variables(cs, MainVars);
982
983#if defined(MIXMASTER)
985#endif
986
987#if defined(HAVE_LIBIDN)
989#endif
990
991 return rc;
992}
993
1000static void init_types(struct ConfigSet *cs)
1001{
1003 CONFIG_INIT_TYPE(cs, Bool);
1004 CONFIG_INIT_TYPE(cs, Enum);
1006 CONFIG_INIT_TYPE(cs, Long);
1007 CONFIG_INIT_TYPE(cs, Mbtable);
1008 CONFIG_INIT_TYPE(cs, MyVar);
1009 CONFIG_INIT_TYPE(cs, Number);
1010 CONFIG_INIT_TYPE(cs, Path);
1011 CONFIG_INIT_TYPE(cs, Quad);
1014 CONFIG_INIT_TYPE(cs, Sort);
1015 CONFIG_INIT_TYPE(cs, String);
1016}
1017
1022static void init_variables(struct ConfigSet *cs)
1023{
1024 // Define the config variables
1025 config_init_main(cs);
1026 CONFIG_INIT_VARS(cs, alias);
1027#if defined(USE_AUTOCRYPT)
1028 CONFIG_INIT_VARS(cs, autocrypt);
1029#endif
1030 CONFIG_INIT_VARS(cs, browser);
1031 CONFIG_INIT_VARS(cs, compose);
1032 CONFIG_INIT_VARS(cs, conn);
1033#if defined(USE_HCACHE)
1034 CONFIG_INIT_VARS(cs, hcache);
1035#endif
1036 CONFIG_INIT_VARS(cs, helpbar);
1037 CONFIG_INIT_VARS(cs, history);
1038 CONFIG_INIT_VARS(cs, imap);
1039 CONFIG_INIT_VARS(cs, index);
1040 CONFIG_INIT_VARS(cs, maildir);
1041 CONFIG_INIT_VARS(cs, mh);
1042 CONFIG_INIT_VARS(cs, mbox);
1043 CONFIG_INIT_VARS(cs, menu);
1044 CONFIG_INIT_VARS(cs, ncrypt);
1045 CONFIG_INIT_VARS(cs, nntp);
1046#if defined(USE_NOTMUCH)
1047 CONFIG_INIT_VARS(cs, notmuch);
1048#endif
1049 CONFIG_INIT_VARS(cs, pager);
1050 CONFIG_INIT_VARS(cs, pattern);
1051 CONFIG_INIT_VARS(cs, pop);
1053 CONFIG_INIT_VARS(cs, sidebar);
1054}
1055
1060void init_config(struct ConfigSet *cs)
1061{
1062 init_types(cs);
1063 init_variables(cs);
1064}
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
Definition: array.h:156
GUI display the mailboxes in a side panel.
@ ED_ATT_NUMBER
AttachPtr.num.
Definition: attach.h:57
@ ED_ATT_TREE
AttachPtr.tree.
Definition: attach.h:58
@ ED_ATT_CHARSET
AttachPtr.body.
Definition: attach.h:56
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
HdrFormatInfo.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:44
@ E_TYPE_STRING
Data is a string.
Definition: definition.h:37
@ E_TYPE_NUMBER
Data is numeric.
Definition: definition.h:38
uint8_t ExpandoParserFlags
Flags for expando_parse(), e.g. EP_CONDITIONAL.
Definition: definition.h:41
#define EP_CONDITIONAL
Expando is being used as a condition.
Definition: definition.h:43
@ ED_ENVELOPE
Envelope ED_ENV_ ExpandoDataEnvelope.
Definition: domain.h:42
@ ED_EMAIL
Email ED_EMA_ ExpandoDataEmail.
Definition: domain.h:41
@ ED_MIXMASTER
Mixmaster ED_MIX_ ExpandoDataMixmaster.
Definition: domain.h:49
@ ED_MENU
Menu ED_MEN_ ExpandoDataMenu.
Definition: domain.h:48
@ 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_INDEX
Index ED_IND_ ExpandoDataIndex.
Definition: domain.h:46
@ ED_ATTACH
Attach ED_ATT_ ExpandoDataAttach.
Definition: domain.h:36
@ ED_BOD_DESCRIPTION
Body.description.
Definition: body.h:105
@ ED_BOD_CHARSET_CONVERT
Body.type.
Definition: body.h:103
@ ED_BOD_DELETED
Body.deleted.
Definition: body.h:104
@ ED_BOD_UNLINK
Body.unlink.
Definition: body.h:114
@ ED_BOD_FILE_SIZE
Body.filename.
Definition: body.h:109
@ ED_BOD_DISPOSITION
Body.disposition.
Definition: body.h:106
@ ED_BOD_ATTACH_QUALIFIES
Body.attach_qualifies.
Definition: body.h:102
@ ED_BOD_MIME_MAJOR
Body.type, Body.xtype.
Definition: body.h:111
@ ED_BOD_TAGGED
Body.tagged.
Definition: body.h:113
@ ED_BOD_ATTACH_COUNT
Body.attach_count.
Definition: body.h:101
@ ED_BOD_FILE
Body.filename.
Definition: body.h:107
@ ED_BOD_MIME_MINOR
Body.subtype.
Definition: body.h:112
@ ED_BOD_FILE_DISPOSITION
Body.d_filename.
Definition: body.h:108
@ ED_BOD_MIME_ENCODING
Body.encoding.
Definition: body.h:110
Structs that make up an email.
@ ED_EMA_ATTACHMENT_COUNT
Email, mutt_count_body_parts()
Definition: email.h:139
@ ED_EMA_DATE_FORMAT_LOCAL
Email.date_sent.
Definition: email.h:144
@ ED_EMA_TAGS_TRANSFORMED
Email.tags, driver_tags_get_transformed()
Definition: email.h:159
@ ED_EMA_THREAD_HIDDEN_COUNT
Email.collapsed, Email.num_hidden, ...
Definition: email.h:161
@ ED_EMA_DATE_FORMAT
Email.date_sent.
Definition: email.h:143
@ ED_EMA_THREAD_TAGS
Email.tags.
Definition: email.h:163
@ ED_EMA_TAGS
Email.tags.
Definition: email.h:158
@ ED_EMA_SIZE
Body.length.
Definition: email.h:153
@ ED_EMA_FLAG_CHARS
Email.deleted, Email.attach_del, ...
Definition: email.h:145
@ ED_EMA_THREAD_NUMBER
Email, mutt_messages_in_thread()
Definition: email.h:162
@ ED_EMA_TO_CHARS
Email, User_is_recipient()
Definition: email.h:164
@ ED_EMA_BODY_CHARACTERS
Body.length.
Definition: email.h:140
@ ED_EMA_STRF
Email.date_sent, Email.zhours, Email.zminutes, Email.zoccident.
Definition: email.h:155
@ ED_EMA_COMBINED_FLAGS
Email.read, Email.old, thread_is_new(), ...
Definition: email.h:141
@ ED_EMA_THREAD_COUNT
Email, mutt_messages_in_thread()
Definition: email.h:160
@ ED_EMA_STATUS_FLAGS
Email.deleted, Email.attach_del, ...
Definition: email.h:154
@ ED_EMA_NUMBER
Email.msgno.
Definition: email.h:151
@ ED_EMA_FROM_LIST
Envelope.to, Envelope.cc.
Definition: email.h:146
@ ED_EMA_SCORE
Email.score.
Definition: email.h:152
@ ED_EMA_CRYPTO_FLAGS
Email.security, SecurityFlags.
Definition: email.h:142
@ ED_EMA_STRF_RECV_LOCAL
Email.received.
Definition: email.h:157
@ ED_EMA_STRF_LOCAL
Email.date_sent.
Definition: email.h:156
@ ED_EMA_LIST_OR_SAVE_FOLDER
Envelope.to, Envelope.cc, check_for_mailing_list()
Definition: email.h:149
@ ED_EMA_INDEX_HOOK
Mailbox, Email, mutt_idxfmt_hook()
Definition: email.h:147
@ ED_EMA_LINES
Email.lines.
Definition: email.h:148
@ ED_EMA_MESSAGE_FLAGS
Email.tagged, Email.flagged.
Definition: email.h:150
@ 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:108
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:111
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:979
struct ExpandoNode * parse_index_hook(const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse an index-hook - Implements ExpandoDefinition::parse() -.
Definition: mutt_config.c:219
struct ExpandoNode * parse_index_date_local(const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse a Date Expando - Implements ExpandoDefinition::parse() -.
Definition: mutt_config.c:182
struct ExpandoNode * parse_subject(const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse a Subject Expando - Implements ExpandoDefinition::parse() -.
Definition: mutt_config.c:261
struct ExpandoNode * parse_index_date_recv_local(const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse a Date Expando - Implements ExpandoDefinition::parse() -.
Definition: mutt_config.c:164
struct ExpandoNode * parse_tags_transformed(const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse a Tags-Transformed Expando - Implements ExpandoDefinition::parse() -.
Definition: mutt_config.c:239
struct ExpandoNode * node_padding_parse(const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse a Padding Expando - Implements ExpandoDefinition::parse() -.
Definition: node_padding.c:232
struct ExpandoNode * node_conddate_parse(const char *str, const char **parsed_until, int did, int uid, struct ExpandoParseError *error)
Parse a CondDate format string - Implements ExpandoDefinition::parse() -.
struct ExpandoNode * parse_index_date(const char *str, const char **parsed_until, int did, int uid, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse a Date Expando - Implements ExpandoDefinition::parse() -.
Definition: mutt_config.c:200
GUI manage the main index (list of emails)
@ ED_IND_LIMIT_COUNT
Mailbox.vcount.
Definition: shared_data.h:59
@ ED_IND_MAILBOX_PATH
Mailbox.pathbuf, Mailbox.name.
Definition: shared_data.h:62
@ ED_IND_DELETED_COUNT
Mailbox.msg_deleted.
Definition: shared_data.h:56
@ ED_IND_NEW_COUNT
Mailbox.msg_new.
Definition: shared_data.h:65
@ ED_IND_MAILBOX_SIZE
Mailbox.size.
Definition: shared_data.h:63
@ ED_IND_LIMIT_PATTERN
MailboxView.pattern.
Definition: shared_data.h:60
@ ED_IND_READ_COUNT
Mailbox.msg_count, Mailbox.msg_unread.
Definition: shared_data.h:69
@ ED_IND_POSTPONED_COUNT
mutt_num_postponed()
Definition: shared_data.h:67
@ ED_IND_FLAGGED_COUNT
Mailbox.msg_flagged.
Definition: shared_data.h:58
@ ED_IND_MESSAGE_COUNT
Mailbox.msg_count.
Definition: shared_data.h:64
@ ED_IND_OLD_COUNT
Mailbox.msg_unread, Mailbox.msg_new.
Definition: shared_data.h:66
@ ED_IND_READONLY
Mailbox.readonly, Mailbox.dontwrite.
Definition: shared_data.h:68
@ ED_IND_UNREAD_COUNT
Mailbox.msg_unread.
Definition: shared_data.h:71
@ ED_IND_TAGGED_COUNT
Mailbox.msg_tagged.
Definition: shared_data.h:70
@ ED_IND_LIMIT_SIZE
MailboxView.vsize.
Definition: shared_data.h:61
@ ED_IND_DESCRIPTION
Mailbox.name.
Definition: shared_data.h:57
@ ED_IND_UNREAD_MAILBOXES
Mailbox, mutt_mailbox_check()
Definition: shared_data.h:72
Config/command parsing.
GUI present the user with a selectable list.
@ ED_MEN_PERCENTAGE
Menu.top, ...
Definition: lib.h:68
Support of Mixmaster anonymous remailer.
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
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:60
static void init_types(struct ConfigSet *cs)
Create the config types.
Definition: mutt_config.c:1000
static struct ConfigDef MainVarsMixmaster[]
Config definitions for the Mixmaster library.
Definition: mutt_config.c:946
const struct Mapping SortMethods[]
Sort methods for '$sort' for the index.
Definition: mutt_config.c:89
static const struct ExpandoDefinition StatusFormatDef[]
Expando definitions.
Definition: mutt_config.c:368
#define CONFIG_INIT_TYPE(CS, NAME)
Definition: mutt_config.c:56
static const struct ExpandoDefinition MixFormatDef[]
Expando definitions.
Definition: mutt_config.c:930
#define MIXMASTER_DEFAULT
Definition: mutt_config.c:919
void init_config(struct ConfigSet *cs)
Initialise the config system.
Definition: mutt_config.c:1060
static struct ConfigDef MainVarsIdn[]
IDN Config definitions for the Mixmaster library.
Definition: mutt_config.c:963
const struct ExpandoDefinition *const StatusFormatDefNoPadding
StatusFormatDefNoPadding - Status format definitions, without padding.
Definition: mutt_config.c:401
static void init_variables(struct ConfigSet *cs)
Define the config variables.
Definition: mutt_config.c:1022
static const struct ExpandoDefinition *const IndexFormatDefNoPadding
IndexFormatDefNoPadding - Index format definitions, without padding.
Definition: mutt_config.c:357
static struct ConfigDef MainVars[]
General Config definitions for NeoMutt.
Definition: mutt_config.c:406
static const struct Mapping SortAuxMethods[]
Sort methods for '$sort_aux' for the index.
Definition: mutt_config.c:67
const struct ExpandoDefinition IndexFormatDef[]
Expando definitions.
Definition: mutt_config.c:296
static const struct ExpandoDefinition AttachFormatDef[]
Expando definitions.
Definition: mutt_config.c:132
NeoMutt Logging.
const struct EnumDef UseThreadsTypeDef
Data for the $use_threads enumeration.
Definition: mutt_thread.c:67
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.
struct ExpandoNode * node_container_new(void)
Create a new Container ExpandoNode.
struct ExpandoNode * node_expando_parse(const char *str, const char **parsed_until, const struct ExpandoDefinition *defs, ExpandoParserFlags flags, struct ExpandoParseError *error)
Parse an Expando format string.
Definition: node_expando.c:237
struct ExpandoNode * node_expando_new(const char *start, const char *end, struct ExpandoFormat *fmt, int did, int uid)
Create a new Expando ExpandoNode.
Definition: node_expando.c:80
struct ExpandoNode * node_expando_parse_enclosure(const char *str, const char **parsed_until, int did, int uid, char terminator, struct ExpandoParseError *error)
Parse an enclosed Expando.
Definition: node_expando.c:296
@ 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
@ ED_MIX_ADDRESS
Remailer.addr.
Definition: remailer.h:56
@ ED_MIX_CAPABILITIES
Remailer, mix_format_caps()
Definition: remailer.h:57
@ ED_MIX_SHORT_NAME
Remailer.shortname.
Definition: remailer.h:59
@ ED_MIX_NUMBER
Remailer.num.
Definition: remailer.h:58
@ SORT_SUBJECT
Sort by the email's subject.
Definition: sort2.h:38
@ SORT_ORDER
Sort by the order the messages appear in the mailbox.
Definition: sort2.h:40
@ SORT_THREADS
Sort by email threads.
Definition: sort2.h:41
@ SORT_SPAM
Sort by the email's spam score.
Definition: sort2.h:49
@ SORT_LABEL
Sort by the emails label.
Definition: sort2.h:54
@ SORT_FROM
Sort by the email's From field.
Definition: sort2.h:39
@ SORT_SIZE
Sort by the size of the email.
Definition: sort2.h:36
@ SORT_RECEIVED
Sort by when the message were delivered locally.
Definition: sort2.h:42
@ SORT_TO
Sort by the email's To field.
Definition: sort2.h:43
@ SORT_DATE
Sort by the date the email was sent.
Definition: sort2.h:35
@ SORT_SCORE
Sort by the email's score.
Definition: sort2.h:44
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:52
Basic Expando Node.
Definition: node.h:69
int uid
Unique ID, e.g. ED_EMA_SIZE.
Definition: node.h:73
struct ExpandoFormat * format
Formatting info.
Definition: node.h:75
const char * end
End of string data.
Definition: node.h:80
struct ExpandoNode * next
Linked list.
Definition: node.h:71
int did
Domain ID, e.g. ED_EMAIL.
Definition: node.h:72
const char * start
Start of string data.
Definition: node.h:79
struct ExpandoNodeArray children
Children nodes.
Definition: node.h:77
Buffer for parsing errors.
Definition: parse.h:34
const char * position
Position of error in original string.
Definition: parse.h:36
char message[256]
Error message.
Definition: parse.h:35
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:85
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_SORT
Value of $sort.
Definition: uid.h:40
@ ED_GLO_PADDING_EOL
Padding to end-of-line.
Definition: uid.h:36
@ ED_GLO_VERSION
NeoMutt version.
Definition: uid.h:43
@ ED_GLO_PADDING_HARD
Hard Padding.
Definition: uid.h:37
@ ED_GLO_PADDING_SOFT
Soft Padding.
Definition: uid.h:38
@ ED_GLO_USE_THREADS
Value of $use_threads.
Definition: uid.h:42
@ ED_GLO_HOSTNAME
Local hostname.
Definition: uid.h:35
@ ED_GLO_SORT_AUX
Value of $sort_aux.
Definition: uid.h:41