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