NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
mutt_config.c
Go to the documentation of this file.
1 
30 #include "config.h"
31 #include <stddef.h>
32 #include <stdbool.h>
33 #include <stdint.h>
34 #include "mutt/lib.h"
35 #include "config/lib.h"
36 #include "core/lib.h"
37 #include "menu/lib.h"
38 #include "init.h"
39 #include "mutt_logging.h"
40 #include "mutt_thread.h"
41 #include "mx.h"
42 #include "options.h"
43 
44 #define CONFIG_INIT_TYPE(CS, NAME) \
45  extern const struct ConfigSetType cst_##NAME; \
46  cs_register_type(CS, &cst_##NAME)
47 
48 #define CONFIG_INIT_VARS(CS, NAME) \
49  bool config_init_##NAME(struct ConfigSet *cs); \
50  config_init_##NAME(CS)
51 
55 static const struct Mapping SortAuxMethods[] = {
56  // clang-format off
57  { "date", SORT_DATE },
58  { "date-sent", SORT_DATE },
59  { "threads", SORT_DATE },
60  { "date-received", SORT_RECEIVED },
61  { "from", SORT_FROM },
62  { "label", SORT_LABEL },
63  { "unsorted", SORT_ORDER },
64  { "mailbox-order", SORT_ORDER },
65  { "score", SORT_SCORE },
66  { "size", SORT_SIZE },
67  { "spam", SORT_SPAM },
68  { "subject", SORT_SUBJECT },
69  { "to", SORT_TO },
70  { NULL, 0 },
71  // clang-format on
72 };
73 
77 const struct Mapping SortMethods[] = {
78  // clang-format off
79  { "date", SORT_DATE },
80  { "date-sent", SORT_DATE },
81  { "date-received", SORT_RECEIVED },
82  { "from", SORT_FROM },
83  { "label", SORT_LABEL },
84  { "unsorted", SORT_ORDER },
85  { "mailbox-order", SORT_ORDER },
86  { "score", SORT_SCORE },
87  { "size", SORT_SIZE },
88  { "spam", SORT_SPAM },
89  { "subject", SORT_SUBJECT },
90  { "threads", SORT_THREADS },
91  { "to", SORT_TO },
92  { NULL, 0 },
93  // clang-format on
94 };
95 
99 const struct Mapping SortBrowserMethods[] = {
100  // clang-format off
101  { "alpha", SORT_SUBJECT },
102  { "count", SORT_COUNT },
103  { "date", SORT_DATE },
104  { "desc", SORT_DESC },
105  { "new", SORT_UNREAD },
106  { "unread", SORT_UNREAD },
107  { "size", SORT_SIZE },
108  { "unsorted", SORT_ORDER },
109  { NULL, 0 },
110  // clang-format on
111 };
112 
116 int multipart_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef,
117  intptr_t value, struct Buffer *err)
118 {
119  if (value == 0)
120  return CSR_SUCCESS;
121 
122  const char *str = (const char *) value;
123 
124  if (mutt_str_equal(str, "inline") || mutt_str_equal(str, "info"))
125  return CSR_SUCCESS;
126 
127  mutt_buffer_printf(err, _("Invalid value for option %s: %s"), cdef->name, str);
128  return CSR_ERR_INVALID;
129 }
130 
134 int reply_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef,
135  intptr_t value, struct Buffer *err)
136 {
137  if (!OptAttachMsg)
138  return CSR_SUCCESS;
139 
140  mutt_buffer_printf(err, _("Option %s may not be set when in attach-message mode"),
141  cdef->name);
142  return CSR_ERR_INVALID;
143 }
144 
145 static struct ConfigDef MainVars[] = {
146  // clang-format off
147  { "abort_backspace", DT_BOOL, true, 0, NULL,
148  "Hitting backspace against an empty prompt aborts the prompt"
149  },
150  { "abort_key", DT_STRING|DT_NOT_EMPTY, IP "\007", 0, NULL,
151  "String representation of key to abort prompts"
152  },
153  { "arrow_cursor", DT_BOOL|R_MENU, false, 0, NULL,
154  "Use an arrow '->' instead of highlighting in the index"
155  },
156  { "arrow_string", DT_STRING|DT_NOT_EMPTY, IP "->", 0, NULL,
157  "Use an custom string for arrow_cursor"
158  },
159  { "ascii_chars", DT_BOOL|R_INDEX|R_PAGER, false, 0, NULL,
160  "Use plain ASCII characters, when drawing email threads"
161  },
162  { "ask_bcc", DT_BOOL, false, 0, NULL,
163  "Ask the user for the blind-carbon-copy recipients"
164  },
165  { "ask_cc", DT_BOOL, false, 0, NULL,
166  "Ask the user for the carbon-copy recipients"
167  },
168  { "assumed_charset", DT_STRING, 0, 0, charset_validator,
169  "If a message is missing a character set, assume this character set"
170  },
171  { "attach_format", DT_STRING|DT_NOT_EMPTY, IP "%u%D%I %t%4n %T%.40d%> [%.7m/%.10M, %.6e%?C?, %C?, %s] ", 0, NULL,
172  "printf-like format string for the attachment menu"
173  },
174  { "attach_save_dir", DT_PATH|DT_PATH_DIR, IP "./", 0, NULL,
175  "Default directory where attachments are saved"
176  },
177  { "attach_save_without_prompting", DT_BOOL, false, 0, NULL,
178  "If true, then don't prompt to save"
179  },
180  { "attach_sep", DT_STRING, IP "\n", 0, NULL,
181  "Separator to add between saved/printed/piped attachments"
182  },
183  { "attach_split", DT_BOOL, true, 0, NULL,
184  "Save/print/pipe tagged messages individually"
185  },
186  { "attribution", DT_STRING, IP "On %d, %n wrote:", 0, NULL,
187  "Message to start a reply, 'On DATE, PERSON wrote:'"
188  },
189  { "attribution_locale", DT_STRING, 0, 0, NULL,
190  "Locale for dates in the attribution message"
191  },
192  { "auto_edit", DT_BOOL, false, 0, NULL,
193  "Skip the initial compose menu and edit the email"
194  },
195  { "auto_subscribe", DT_BOOL, false, 0, NULL,
196  "Automatically check if the user is subscribed to a mailing list"
197  },
198  { "auto_tag", DT_BOOL, false, 0, NULL,
199  "Automatically apply actions to all tagged messages"
200  },
201  { "beep", DT_BOOL, true, 0, NULL,
202  "Make a noise when an error occurs"
203  },
204  { "beep_new", DT_BOOL, false, 0, NULL,
205  "Make a noise when new mail arrives"
206  },
207  { "bounce", DT_QUAD, MUTT_ASKYES, 0, NULL,
208  "Confirm before bouncing a message"
209  },
210  { "braille_friendly", DT_BOOL, false, 0, NULL,
211  "Move the cursor to the beginning of the line"
212  },
213  { "browser_abbreviate_mailboxes", DT_BOOL, true, 0, NULL,
214  "Abbreviate mailboxes using '~' and '=' in the browser"
215  },
217  "Default character set for displaying text on screen"
218  },
219  { "collapse_flagged", DT_BOOL, true, 0, NULL,
220  "Prevent the collapse of threads with flagged emails"
221  },
222  { "collapse_unread", DT_BOOL, true, 0, NULL,
223  "Prevent the collapse of threads with unread emails"
224  },
225  { "config_charset", DT_STRING, 0, 0, charset_validator,
226  "Character set that the config files are in"
227  },
228  { "confirm_append", DT_BOOL, true, 0, NULL,
229  "Confirm before appending emails to a mailbox"
230  },
231  { "confirm_create", DT_BOOL, true, 0, NULL,
232  "Confirm before creating a new mailbox"
233  },
234  { "copy_decode_weed", DT_BOOL, false, 0, NULL,
235  "Controls whether to weed headers when copying or saving emails"
236  },
237  { "count_alternatives", DT_BOOL, false, 0, NULL,
238  "Recurse inside multipart/alternatives while counting attachments"
239  },
240  { "crypt_chars", DT_MBTABLE|R_INDEX|R_PAGER, IP "SPsK ", 0, NULL,
241  "User-configurable crypto flags: signed, encrypted etc."
242  },
243  { "date_format", DT_STRING|DT_NOT_EMPTY|R_MENU, IP "!%a, %b %d, %Y at %I:%M:%S%p %Z", 0, NULL,
244  "strftime format string for the `%d` expando"
245  },
246  { "debug_file", DT_PATH|DT_PATH_FILE, IP "~/.neomuttdebug", 0, NULL,
247  "File to save debug logs"
248  },
249  { "debug_level", DT_NUMBER, 0, 0, level_validator,
250  "Logging level for debug logs"
251  },
252  { "default_hook", DT_STRING, IP "~f %s !~P | (~P ~C %s)", 0, NULL,
253  "Pattern to use for hooks that only have a simple regex"
254  },
255  { "delete", DT_QUAD, MUTT_ASKYES, 0, NULL,
256  "Really delete messages, when the mailbox is closed"
257  },
258  { "delete_untag", DT_BOOL, true, 0, NULL,
259  "Untag messages when they are marked for deletion"
260  },
261  { "digest_collapse", DT_BOOL, true, 0, NULL,
262  "Hide the subparts of a multipart/digest"
263  },
264  { "display_filter", DT_STRING|DT_COMMAND|R_PAGER, 0, 0, NULL,
265  "External command to pre-process an email before display"
266  },
267  { "duplicate_threads", DT_BOOL|R_RESORT|R_RESORT_INIT|R_INDEX, true, 0, NULL,
268  "Highlight messages with duplicated message IDs"
269  },
270  { "editor", DT_STRING|DT_NOT_EMPTY|DT_COMMAND, 0, 0, NULL,
271  "External command to use as an email editor"
272  },
273  { "flag_chars", DT_MBTABLE|R_INDEX|R_PAGER, IP "*!DdrONon- ", 0, NULL,
274  "User-configurable index flags: tagged, new, etc"
275  },
276  { "flag_safe", DT_BOOL, false, 0, NULL,
277  "Protect flagged messages from deletion"
278  },
279  { "folder", DT_STRING|DT_MAILBOX, IP "~/Mail", 0, NULL,
280  "Base folder for a set of mailboxes"
281  },
282  { "folder_format", DT_STRING|DT_NOT_EMPTY|R_MENU, IP "%2C %t %N %F %2l %-8.8u %-8.8g %8s %d %i", 0, NULL,
283  "printf-like format string for the browser's display of folders"
284  },
285  { "force_name", DT_BOOL, false, 0, NULL,
286  "Save outgoing mail in a folder of their name"
287  },
288  { "forward_attachments", DT_QUAD, MUTT_ASKYES, 0, NULL,
289  "Forward attachments when forwarding a message"
290  },
291  { "forward_decode", DT_BOOL, true, 0, NULL,
292  "Decode the message when forwarding it"
293  },
294  { "forward_quote", DT_BOOL, false, 0, NULL,
295  "Automatically quote a forwarded message using `$indent_string`"
296  },
297  { "from", DT_ADDRESS, 0, 0, NULL,
298  "Default 'From' address to use, if isn't otherwise set"
299  },
300  { "from_chars", DT_MBTABLE|R_INDEX|R_PAGER, 0, 0, NULL,
301  "User-configurable index flags: to address, cc address, etc"
302  },
303  { "gecos_mask", DT_REGEX, IP "^[^,]*", 0, NULL,
304  "Regex for parsing GECOS field of /etc/passwd"
305  },
306  { "greeting", DT_STRING, 0, 0, NULL,
307  "Greeting string added to the top of all messages"
308  },
309  { "header", DT_BOOL, false, 0, NULL,
310  "Include the message headers in the reply email (Weed applies)"
311  },
312  { "hidden_tags", DT_SLIST|SLIST_SEP_COMMA, IP "unread,draft,flagged,passed,replied,attachment,signed,encrypted", 0, NULL,
313  "List of tags that shouldn't be displayed on screen (comma-separated)"
314  },
315  { "hide_limited", DT_BOOL|R_TREE|R_INDEX, false, 0, NULL,
316  "Don't indicate hidden messages, in the thread tree"
317  },
318  { "hide_missing", DT_BOOL|R_TREE|R_INDEX, true, 0, NULL,
319  "Don't indicate missing messages, in the thread tree"
320  },
321  { "hide_thread_subject", DT_BOOL|R_TREE|R_INDEX, true, 0, NULL,
322  "Hide subjects that are similar to that of the parent message"
323  },
324  { "hide_top_limited", DT_BOOL|R_TREE|R_INDEX, false, 0, NULL,
325  "Don't indicate hidden top message, in the thread tree"
326  },
327  { "hide_top_missing", DT_BOOL|R_TREE|R_INDEX, true, 0, NULL,
328  "Don't indicate missing top message, in the thread tree"
329  },
330  { "honor_disposition", DT_BOOL, false, 0, NULL,
331  "Don't display MIME parts inline if they have a disposition of 'attachment'"
332  },
333  { "hostname", DT_STRING, 0, 0, NULL,
334  "Fully-qualified domain name of this machine"
335  },
336 #ifdef HAVE_LIBIDN
337  { "idn_decode", DT_BOOL|R_MENU, true, 0, NULL,
338  "(idn) Decode international domain names"
339  },
340  { "idn_encode", DT_BOOL|R_MENU, true, 0, NULL,
341  "(idn) Encode international domain names"
342  },
343 #endif
344  { "implicit_autoview", DT_BOOL, false, 0, NULL,
345  "Display MIME attachments inline if a 'copiousoutput' mailcap entry exists"
346  },
347  { "include_encrypted", DT_BOOL, false, 0, NULL,
348  "Whether to include encrypted content when replying"
349  },
350  { "include_only_first", DT_BOOL, false, 0, NULL,
351  "Only include the first attachment when replying"
352  },
353  { "indent_string", DT_STRING, IP "> ", 0, NULL,
354  "String used to indent 'reply' text"
355  },
356  { "index_format", DT_STRING|DT_NOT_EMPTY|R_INDEX|R_PAGER, IP "%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?) %s", 0, NULL,
357  "printf-like format string for the index menu (emails)"
358  },
359  { "keep_flagged", DT_BOOL, false, 0, NULL,
360  "Don't move flagged messages from `$spool_file` to `$mbox`"
361  },
362  { "local_date_header", DT_BOOL, true, 0, NULL,
363  "Convert the date in the Date header of sent emails into local timezone, UTC otherwise"
364  },
365  { "mail_check", DT_NUMBER|DT_NOT_NEGATIVE, 5, 0, NULL,
366  "Number of seconds before NeoMutt checks for new mail"
367  },
368  { "mail_check_recent", DT_BOOL, true, 0, NULL,
369  "Notify the user about new mail since the last time the mailbox was opened"
370  },
371  { "mail_check_stats", DT_BOOL, false, 0, NULL,
372  "Periodically check for new mail"
373  },
374  { "mail_check_stats_interval", DT_NUMBER|DT_NOT_NEGATIVE, 60, 0, NULL,
375  "How often to check for new mail"
376  },
377  { "mailcap_path", DT_SLIST|SLIST_SEP_COLON, IP "~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap", 0, NULL,
378  "List of mailcap files (colon-separated)"
379  },
380  { "mailcap_sanitize", DT_BOOL, true, 0, NULL,
381  "Restrict the possible characters in mailcap expandos"
382  },
383  { "mark_old", DT_BOOL|R_INDEX|R_PAGER, true, 0, NULL,
384  "Mark new emails as old when leaving the mailbox"
385  },
386  { "markers", DT_BOOL|R_PAGER_FLOW, true, 0, NULL,
387  "Display a '+' at the beginning of wrapped lines in the pager"
388  },
389  { "mask", DT_REGEX|DT_REGEX_MATCH_CASE|DT_REGEX_ALLOW_NOT|DT_REGEX_NOSUB, IP "!^\\.[^.]", 0, NULL,
390  "Only display files/dirs matching this regex in the browser"
391  },
392  { "mbox", DT_STRING|DT_MAILBOX|R_INDEX|R_PAGER, IP "~/mbox", 0, NULL,
393  "Folder that receives read emails (see Move)"
394  },
395  { "mbox_type", DT_ENUM, MUTT_MBOX, IP &MboxTypeDef, NULL,
396  "Default type for creating new mailboxes"
397  },
398  { "message_cache_clean", DT_BOOL, false, 0, NULL,
399  "(imap/pop) Clean out obsolete entries from the message cache"
400  },
401  { "message_cachedir", DT_PATH|DT_PATH_DIR, 0, 0, NULL,
402  "(imap/pop) Directory for the message cache"
403  },
404  { "message_format", DT_STRING|DT_NOT_EMPTY, IP "%s", 0, NULL,
405  "printf-like format string for listing attached messages"
406  },
407  { "meta_key", DT_BOOL, false, 0, NULL,
408  "Interpret 'ALT-x' as 'ESC-x'"
409  },
410  { "mime_forward", DT_QUAD, MUTT_NO, 0, NULL,
411  "Forward a message as a 'message/RFC822' MIME part"
412  },
413  { "mime_forward_rest", DT_QUAD, MUTT_YES, 0, NULL,
414  "Forward all attachments, even if they can't be decoded"
415  },
416 #ifdef MIXMASTER
417  { "mix_entry_format", DT_STRING|DT_NOT_EMPTY, IP "%4n %c %-16s %a", 0, NULL,
418  "(mixmaster) printf-like format string for the mixmaster chain"
419  },
420  { "mixmaster", DT_STRING|DT_COMMAND, IP MIXMASTER, 0, NULL,
421  "(mixmaster) External command to route a mixmaster message"
422  },
423 #endif
424  { "move", DT_QUAD, MUTT_NO, 0, NULL,
425  "Move emails from `$spool_file` to `$mbox` when read"
426  },
427  { "narrow_tree", DT_BOOL|R_TREE|R_INDEX, false, 0, NULL,
428  "Draw a narrower thread tree in the index"
429  },
430  { "net_inc", DT_NUMBER|DT_NOT_NEGATIVE, 10, 0, NULL,
431  "(socket) Update the progress bar after this many KB sent/received (0 to disable)"
432  },
433  { "new_mail_command", DT_STRING|DT_COMMAND, 0, 0, NULL,
434  "External command to run when new mail arrives"
435  },
436  { "pager", DT_STRING|DT_COMMAND, IP "builtin", 0, NULL,
437  "External command for viewing messages, or 'builtin' to use NeoMutt's"
438  },
439  { "pager_format", DT_STRING|R_PAGER, IP "-%Z- %C/%m: %-20.20n %s%* -- (%P)", 0, NULL,
440  "printf-like format string for the pager's status bar"
441  },
442  { "pipe_decode", DT_BOOL, false, 0, NULL,
443  "Decode the message when piping it"
444  },
445  { "pipe_decode_weed", DT_BOOL, true, 0, NULL,
446  "Control whether to weed headers when piping an email"
447  },
448  { "pipe_sep", DT_STRING, IP "\n", 0, NULL,
449  "Separator to add between multiple piped messages"
450  },
451  { "pipe_split", DT_BOOL, false, 0, NULL,
452  "Run the pipe command on each message separately"
453  },
454  { "postponed", DT_STRING|DT_MAILBOX|R_INDEX, IP "~/postponed", 0, NULL,
455  "Folder to store postponed messages"
456  },
457  { "preferred_languages", DT_SLIST|SLIST_SEP_COMMA, 0, 0, NULL,
458  "List of Preferred Languages for multilingual MIME (comma-separated)"
459  },
460  { "print", DT_QUAD, MUTT_ASKNO, 0, NULL,
461  "Confirm before printing a message"
462  },
463  { "print_command", DT_STRING|DT_COMMAND, IP "lpr", 0, NULL,
464  "External command to print a message"
465  },
466  { "print_decode", DT_BOOL, true, 0, NULL,
467  "Decode message before printing it"
468  },
469  { "print_decode_weed", DT_BOOL, true, 0, NULL,
470  "Control whether to weed headers when printing an email "
471  },
472  { "print_split", DT_BOOL, false, 0, NULL,
473  "Print multiple messages separately"
474  },
475  { "prompt_after", DT_BOOL, true, 0, NULL,
476  "Pause after running an external pager"
477  },
478  { "quit", DT_QUAD, MUTT_YES, 0, NULL,
479  "Prompt before exiting NeoMutt"
480  },
481  { "quote_regex", DT_REGEX|R_PAGER, IP "^([ \t]*[|>:}#])+", 0, NULL,
482  "Regex to match quoted text in a reply"
483  },
484  { "read_inc", DT_NUMBER|DT_NOT_NEGATIVE, 10, 0, NULL,
485  "Update the progress bar after this many records read (0 to disable)"
486  },
487  { "read_only", DT_BOOL, false, 0, NULL,
488  "Open folders in read-only mode"
489  },
490  { "real_name", DT_STRING|R_INDEX|R_PAGER, 0, 0, NULL,
491  "Real name of the user"
492  },
493  { "record", DT_STRING|DT_MAILBOX, IP "~/sent", 0, NULL,
494  "Folder to save 'sent' messages"
495  },
496  { "reflow_space_quotes", DT_BOOL, true, 0, NULL,
497  "Insert spaces into reply quotes for 'format=flowed' messages"
498  },
499  { "reflow_text", DT_BOOL, true, 0, NULL,
500  "Reformat paragraphs of 'format=flowed' text"
501  },
502  { "reflow_wrap", DT_NUMBER, 78, 0, NULL,
503  "Maximum paragraph width for reformatting 'format=flowed' text"
504  },
505  { "reply_regex", DT_REGEX|R_INDEX|R_RESORT, IP "^((re|aw|sv)(\\[[0-9]+\\])*:[ \t]*)*", 0, reply_validator,
506  "Regex to match message reply subjects like 're: '"
507  },
508  { "resolve", DT_BOOL, true, 0, NULL,
509  "Move to the next email whenever a command modifies an email"
510  },
511  { "resume_draft_files", DT_BOOL, false, 0, NULL,
512  "Process draft files like postponed messages"
513  },
514  { "resume_edited_draft_files", DT_BOOL, true, 0, NULL,
515  "Resume editing previously saved draft files"
516  },
517  { "reverse_alias", DT_BOOL|R_INDEX|R_PAGER, false, 0, NULL,
518  "Display the alias in the index, rather than the message's sender"
519  },
520  { "rfc2047_parameters", DT_BOOL, false, 0, NULL,
521  "Decode RFC2047-encoded MIME parameters"
522  },
523  { "save_address", DT_BOOL, false, 0, NULL,
524  "Use sender's full address as a default save folder"
525  },
526  { "save_empty", DT_BOOL, true, 0, NULL,
527  "(mbox,mmdf) Preserve empty mailboxes"
528  },
529  { "save_name", DT_BOOL, false, 0, NULL,
530  "Save outgoing message to mailbox of recipient's name if it exists"
531  },
532  { "score", DT_BOOL, true, 0, NULL,
533  "Use message scoring"
534  },
535  { "score_threshold_delete", DT_NUMBER, -1, 0, NULL,
536  "Messages with a lower score will be automatically deleted"
537  },
538  { "score_threshold_flag", DT_NUMBER, 9999, 0, NULL,
539  "Messages with a greater score will be automatically flagged"
540  },
541  { "score_threshold_read", DT_NUMBER, -1, 0, NULL,
542  "Messages with a lower score will be automatically marked read"
543  },
544  { "send_charset", DT_STRING|DT_CHARSET_STRICT, IP "us-ascii:iso-8859-1:utf-8", 0, charset_validator,
545  "Character sets for outgoing mail"
546  },
547  { "shell", DT_STRING|DT_COMMAND, IP "/bin/sh", 0, NULL,
548  "External command to run subshells in"
549  },
550  { "show_multipart_alternative", DT_STRING, 0, 0, multipart_validator,
551  "How to display 'multipart/alternative' MIME parts"
552  },
553  { "simple_search", DT_STRING, IP "~f %s | ~s %s", 0, NULL,
554  "Pattern to search for when search doesn't contain ~'s"
555  },
556  { "size_show_bytes", DT_BOOL|R_MENU, false, 0, NULL,
557  "Show smaller sizes in bytes"
558  },
559  { "size_show_fractions", DT_BOOL|R_MENU, true, 0, NULL,
560  "Show size fractions with a single decimal place"
561  },
562  { "size_show_mb", DT_BOOL|R_MENU, true, 0, NULL,
563  "Show sizes in megabytes for sizes greater than 1 megabyte"
564  },
565  { "size_units_on_left", DT_BOOL|R_MENU, false, 0, NULL,
566  "Show the units as a prefix to the size"
567  },
568  { "sleep_time", DT_NUMBER|DT_NOT_NEGATIVE, 1, 0, NULL,
569  "Time to pause after certain info messages"
570  },
572  "Sort method for the index"
573  },
575  "Secondary sort method for the index"
576  },
577  { "sort_browser", DT_SORT|DT_SORT_REVERSE, SORT_ALPHA, IP SortBrowserMethods, NULL,
578  "Sort method for the browser"
579  },
580  { "sort_re", DT_BOOL|R_INDEX|R_RESORT|R_RESORT_INIT, true, 0, NULL,
581  "Whether $reply_regex must be matched when not $strict_threads"
582  },
583  { "spam_separator", DT_STRING, IP ",", 0, NULL,
584  "Separator for multiple spam headers"
585  },
586  { "spool_file", DT_STRING|DT_MAILBOX, 0, 0, NULL,
587  "Inbox"
588  },
589  { "status_chars", DT_MBTABLE|R_INDEX|R_PAGER, IP "-*%A", 0, NULL,
590  "Indicator characters for the status bar"
591  },
592  { "status_format", DT_STRING|R_INDEX|R_PAGER, IP "-%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)---", 0, NULL,
593  "printf-like format string for the index's status line"
594  },
595  { "status_on_top", DT_BOOL, false, 0, NULL,
596  "Display the status bar at the top"
597  },
598  { "strict_threads", DT_BOOL|R_RESORT|R_RESORT_INIT|R_INDEX, false, 0, NULL,
599  "Thread messages using 'In-Reply-To' and 'References' headers"
600  },
601  { "suspend", DT_BOOL, true, 0, NULL,
602  "Allow the user to suspend NeoMutt using '^Z'"
603  },
604  { "text_flowed", DT_BOOL, false, 0, NULL,
605  "Generate 'format=flowed' messages"
606  },
607  { "thread_received", DT_BOOL|R_RESORT|R_RESORT_INIT|R_INDEX, false, 0, NULL,
608  "Sort threaded messages by their received date"
609  },
610  { "time_inc", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
611  "Frequency of progress bar updates (milliseconds)"
612  },
613  { "timeout", DT_NUMBER|DT_NOT_NEGATIVE, 600, 0, NULL,
614  "Time to wait for user input in menus"
615  },
616  { "tmpdir", DT_PATH|DT_PATH_DIR|DT_NOT_EMPTY, IP TMPDIR, 0, NULL,
617  "Directory for temporary files"
618  },
619  { "to_chars", DT_MBTABLE|R_INDEX|R_PAGER, IP " +TCFLR", 0, NULL,
620  "Indicator characters for the 'To' field in the index"
621  },
622  { "toggle_quoted_show_levels", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
623  "Number of quote levels to show with toggle-quoted"
624  },
625  { "trash", DT_STRING|DT_MAILBOX, 0, 0, NULL,
626  "Folder to put deleted emails"
627  },
628  { "ts_enabled", DT_BOOL|R_INDEX|R_PAGER, false, 0, NULL,
629  "Allow NeoMutt to set the terminal status line and icon"
630  },
631  { "ts_icon_format", DT_STRING|R_INDEX|R_PAGER, IP "M%?n?AIL&ail?", 0, NULL,
632  "printf-like format string for the terminal's icon title"
633  },
634  { "ts_status_format", DT_STRING|R_INDEX|R_PAGER, IP "NeoMutt with %?m?%m messages&no messages?%?n? [%n NEW]?", 0, NULL,
635  "printf-like format string for the terminal's status (window title)"
636  },
637  { "use_domain", DT_BOOL, true, 0, NULL,
638  "Qualify local addresses using this domain"
639  },
640  { "use_threads", DT_ENUM|R_INDEX|R_RESORT, UT_UNSET, IP &UseThreadsTypeDef, NULL,
641  "Whether to use threads for the index"
642  },
643  { "wait_key", DT_BOOL, true, 0, NULL,
644  "Prompt to press a key after running external commands"
645  },
646  { "weed", DT_BOOL, true, 0, NULL,
647  "Filter headers when displaying/forwarding/printing/replying"
648  },
649  { "wrap", DT_NUMBER|R_PAGER_FLOW, 0, 0, NULL,
650  "Width to wrap text in the pager"
651  },
652  { "wrap_search", DT_BOOL, true, 0, NULL,
653  "Wrap around when the search hits the end"
654  },
655  { "write_bcc", DT_BOOL, false, 0, NULL,
656  "Write out the 'Bcc' field when preparing to send a mail"
657  },
658  { "write_inc", DT_NUMBER|DT_NOT_NEGATIVE, 10, 0, NULL,
659  "Update the progress bar after this many records written (0 to disable)"
660  },
661 
662  { "escape", DT_DEPRECATED|DT_STRING, IP "~" },
663  { "ignore_linear_white_space", DT_DEPRECATED|DT_BOOL, false },
664  { "visual", DT_DEPRECATED|DT_STRING|DT_COMMAND, 0 },
665 
666  { "askbcc", DT_SYNONYM, IP "ask_bcc", },
667  { "askcc", DT_SYNONYM, IP "ask_cc", },
668  { "autoedit", DT_SYNONYM, IP "auto_edit", },
669  { "confirmappend", DT_SYNONYM, IP "confirm_append", },
670  { "confirmcreate", DT_SYNONYM, IP "confirm_create", },
671  { "edit_hdrs", DT_SYNONYM, IP "edit_headers", },
672  { "forw_decode", DT_SYNONYM, IP "forward_decode", },
673  { "forw_quote", DT_SYNONYM, IP "forward_quote", },
674  { "hdr_format", DT_SYNONYM, IP "index_format", },
675  { "include_onlyfirst", DT_SYNONYM, IP "include_only_first", },
676  { "indent_str", DT_SYNONYM, IP "indent_string", },
677  { "mime_fwd", DT_SYNONYM, IP "mime_forward", },
678  { "msg_format", DT_SYNONYM, IP "message_format", },
679  { "print_cmd", DT_SYNONYM, IP "print_command", },
680  { "quote_regexp", DT_SYNONYM, IP "quote_regex", },
681  { "realname", DT_SYNONYM, IP "real_name", },
682  { "reply_regexp", DT_SYNONYM, IP "reply_regex", },
683  { "spoolfile", DT_SYNONYM, IP "spool_file", },
684  { "xterm_icon", DT_SYNONYM, IP "ts_icon_format", },
685  { "xterm_set_titles", DT_SYNONYM, IP "ts_enabled", },
686  { "xterm_title", DT_SYNONYM, IP "ts_status_format", },
687 
688  { NULL },
689  // clang-format on
690 };
691 
695 static bool config_init_main(struct ConfigSet *cs)
696 {
697  return cs_register_variables(cs, MainVars, 0);
698 }
699 
706 static void init_types(struct ConfigSet *cs)
707 {
708  CONFIG_INIT_TYPE(cs, address);
709  CONFIG_INIT_TYPE(cs, bool);
710  CONFIG_INIT_TYPE(cs, enum);
711  CONFIG_INIT_TYPE(cs, long);
712  CONFIG_INIT_TYPE(cs, mbtable);
713  CONFIG_INIT_TYPE(cs, number);
714  CONFIG_INIT_TYPE(cs, path);
715  CONFIG_INIT_TYPE(cs, quad);
716  CONFIG_INIT_TYPE(cs, regex);
717  CONFIG_INIT_TYPE(cs, slist);
718  CONFIG_INIT_TYPE(cs, sort);
719  CONFIG_INIT_TYPE(cs, string);
720 }
721 
726 static void init_variables(struct ConfigSet *cs)
727 {
728  // Define the config variables
729  config_init_main(cs);
730  CONFIG_INIT_VARS(cs, alias);
731 #ifdef USE_AUTOCRYPT
732  CONFIG_INIT_VARS(cs, autocrypt);
733 #endif
734  CONFIG_INIT_VARS(cs, compose);
735  CONFIG_INIT_VARS(cs, conn);
736 #ifdef USE_HCACHE
737  CONFIG_INIT_VARS(cs, hcache);
738 #endif
739  CONFIG_INIT_VARS(cs, helpbar);
740  CONFIG_INIT_VARS(cs, history);
741  CONFIG_INIT_VARS(cs, index);
742 #ifdef USE_IMAP
743  CONFIG_INIT_VARS(cs, imap);
744 #endif
745  CONFIG_INIT_VARS(cs, maildir);
746  CONFIG_INIT_VARS(cs, mbox);
747  CONFIG_INIT_VARS(cs, menu);
748  CONFIG_INIT_VARS(cs, ncrypt);
749 #ifdef USE_NNTP
750  CONFIG_INIT_VARS(cs, nntp);
751 #endif
752 #ifdef USE_NOTMUCH
753  CONFIG_INIT_VARS(cs, notmuch);
754 #endif
755  CONFIG_INIT_VARS(cs, pager);
756  CONFIG_INIT_VARS(cs, pattern);
757 #ifdef USE_POP
758  CONFIG_INIT_VARS(cs, pop);
759 #endif
760  CONFIG_INIT_VARS(cs, send);
761 #ifdef USE_SIDEBAR
762  CONFIG_INIT_VARS(cs, sidebar);
763 #endif
764 }
765 
770 void init_config(struct ConfigSet *cs)
771 {
772  init_types(cs);
773  init_variables(cs);
774 }
static const struct Mapping SortAuxMethods[]
Sort methods for &#39;$sort_aux&#39; for the index.
Definition: mutt_config.c:55
#define CSR_SUCCESS
Action completed successfully.
Definition: set.h:35
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:904
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:116
#define R_PAGER
Redraw the pager menu.
Definition: types.h:66
#define CONFIG_INIT_TYPE(CS, NAME)
Definition: mutt_config.c:44
Ask the user, defaulting to &#39;No&#39;.
Definition: quad.h:40
Container for lots of config items.
Definition: set.h:259
#define IP
Definition: set.h:54
#define CSR_ERR_INVALID
Value hasn&#39;t been set.
Definition: set.h:38
#define DT_NOT_EMPTY
Empty strings are not allowed.
Definition: types.h:46
Config/command parsing.
#define R_PAGER_FLOW
Reflow line_info and redraw the pager menu.
Definition: types.h:67
#define DT_CHARSET_SINGLE
Flag for charset_validator to allow only one charset.
Definition: charset.h:28
const struct Mapping SortMethods[]
Sort methods for &#39;$sort&#39; for the index.
Definition: mutt_config.c:77
static void init_variables(struct ConfigSet *cs)
Define the config variables.
Definition: mutt_config.c:726
#define DT_REGEX
regular expressions
Definition: types.h:38
NeoMutt Logging.
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:118
String manipulation buffer.
Definition: buffer.h:33
#define DT_REGEX_MATCH_CASE
Case-sensitive matching.
Definition: regex3.h:36
Sort by the email&#39;s From field.
Definition: sort2.h:47
#define DT_SORT
sorting methods
Definition: types.h:40
#define _(a)
Definition: message.h:28
#define DT_CHARSET_STRICT
Flag for charset_validator to use strict char check.
Definition: charset.h:29
Sort by the email&#39;s score.
Definition: sort2.h:52
#define CONFIG_INIT_VARS(CS, NAME)
Definition: mutt_config.c:48
#define DT_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:47
Not yet set by user, stick to legacy semantics.
Definition: mutt_thread.h:79
#define DT_SLIST
a list of strings
Definition: types.h:39
Sort by the emails label.
Definition: sort2.h:62
#define DT_MBTABLE
multibyte char table
Definition: types.h:34
int reply_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "reply_regex" config variable - Implements ConfigDef::validator() -. ...
Definition: mutt_config.c:134
#define DT_SORT_REVERSE
Sort flag for -reverse prefix.
Definition: sort2.h:36
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:160
Definition: set.h:63
int value
Definition: mapping.h:34
#define DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition: types.h:37
#define R_RESORT
Resort the mailbox.
Definition: types.h:68
const struct Mapping SortBrowserMethods[]
Sort methods for the folder/dir browser.
Definition: mutt_config.c:99
Convenience wrapper for the config headers.
#define DT_PATH_DIR
Path is a directory.
Definition: types.h:53
#define R_TREE
Redraw the thread tree.
Definition: types.h:71
#define DT_SORT_LAST
Sort flag for -last prefix.
Definition: sort2.h:35
Sort by the size of the email.
Definition: sort2.h:44
API for mailboxes.
static void init_types(struct ConfigSet *cs)
Create the config types.
Definition: mutt_config.c:706
Sort by the order the messages appear in the mailbox.
Definition: sort2.h:48
Convenience wrapper for the core headers.
#define DT_REGEX_NOSUB
Do not report what was matched (REG_NOSUB)
Definition: regex3.h:38
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[], uint32_t flags)
Register a set of config items.
Definition: set.c:276
const char * name
User-visible name.
Definition: set.h:65
#define DT_PATH_FILE
Path is a file.
Definition: types.h:54
#define R_MENU
Redraw all menus.
Definition: types.h:72
#define DT_ADDRESS
e-mail address
Definition: types.h:29
int charset_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "charset" config variable - Implements ConfigDef::validator() -.
Definition: charset.c:39
struct EnumDef UseThreadsTypeDef
Definition: mutt_thread.c:74
#define DT_STRING
a string
Definition: types.h:41
#define R_RESORT_SUB
Resort subthreads.
Definition: types.h:69
Sort by email threads.
Definition: sort2.h:49
WHERE bool OptAttachMsg
(pseudo) used by attach-message
Definition: options.h:31
#define DT_PATH
a path to a file/directory
Definition: types.h:36
int sort_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate values of "sort" - Implements ConfigDef::validator() -.
Definition: mutt_thread.c:116
Create/manipulate threading in emails.
#define SLIST_SEP_COMMA
Definition: slist.h:34
#define DT_DEPRECATED
Config item shouldn&#39;t be used any more.
Definition: types.h:77
#define DT_MAILBOX
Don&#39;t perform path expansions.
Definition: types.h:48
#define DT_COMMAND
A command.
Definition: types.h:50
Ask the user, defaulting to &#39;Yes&#39;.
Definition: quad.h:41
Sort by the email&#39;s spam score.
Definition: sort2.h:57
Sort by the email&#39;s To field.
Definition: sort2.h:51
&#39;mbox&#39; Mailbox type
Definition: mailbox.h:48
Required by makedoc.c.
Definition: sort2.h:45
#define SLIST_SEP_COLON
Definition: slist.h:35
#define DT_SYNONYM
synonym for another variable
Definition: types.h:42
Sort by the number of unread emails.
Definition: sort2.h:59
#define DT_REGEX_ALLOW_NOT
Regex can begin with &#39;!&#39;.
Definition: regex3.h:37
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:306
Sort by the folder&#39;s description.
Definition: sort2.h:63
#define DT_ENUM
an enumeration
Definition: types.h:31
struct EnumDef MboxTypeDef
Definition: mx.c:98
Mapping between user-readable string and a constant.
Definition: mapping.h:31
User answered &#39;No&#39;, or assume &#39;No&#39;.
Definition: quad.h:38
#define R_RESORT_INIT
Resort from scratch.
Definition: types.h:70
Sort by number of emails in a folder.
Definition: sort2.h:58
Handling of global boolean variables.
Sort by when the message were delivered locally.
Definition: sort2.h:50
Sort by the date the email was sent.
Definition: sort2.h:43
Convenience wrapper for the library headers.
#define DT_NUMBER
a number
Definition: types.h:35
#define DT_BOOL
boolean option
Definition: types.h:30
Sort by the email&#39;s subject.
Definition: sort2.h:46
void init_config(struct ConfigSet *cs)
Initialise the config system.
Definition: mutt_config.c:770
User answered &#39;Yes&#39;, or assume &#39;Yes&#39;.
Definition: quad.h:39
#define R_INDEX
Redraw the index menu (MENU_MAIN)
Definition: types.h:65
static bool config_init_main(struct ConfigSet *cs)
Register main config variables - Implements module_init_config_t -.
Definition: mutt_config.c:695