NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
module.c File Reference

Definition of the Main Module. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "config/lib.h"
#include "core/lib.h"
+ Include dependency graph for module.c:

Go to the source code of this file.

Functions

static bool main_config_define_variables (struct NeoMutt *n, struct ConfigSet *cs)
 Define the Config Variables - Implements Module::config_define_variables()
 

Variables

struct ConfigDef MainVars []
 General Config definitions for NeoMutt.
 
const struct Module ModuleMain
 Module for the Main library.
 

Detailed Description

Definition of the Main Module.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file module.c.

Function Documentation

◆ main_config_define_variables()

static bool main_config_define_variables ( struct NeoMutt * n,
struct ConfigSet * cs )
static

Define the Config Variables - Implements Module::config_define_variables()

Definition at line 40 of file module.c.

41{
43}
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition set.c:290
struct ConfigDef MainVars[]
General Config definitions for NeoMutt.
+ Here is the call graph for this function:

Variable Documentation

◆ MainVars

struct ConfigDef MainVars[]
extern

General Config definitions for NeoMutt.

Definition at line 359 of file mutt_config.c.

359 {
360 // clang-format off
361 { "abort_backspace", DT_BOOL, true, 0, NULL,
362 "Hitting backspace against an empty prompt aborts the prompt"
363 },
364 { "abort_key", DT_STRING|D_NOT_EMPTY|D_ON_STARTUP, IP "\007", 0, NULL,
365 "String representation of key to abort prompts"
366 },
367 { "ascii_chars", DT_BOOL, false, 0, NULL,
368 "Use plain ASCII characters, when drawing email threads"
369 },
371 "If a message is missing a character set, assume this character set"
372 },
373 { "attach_format", DT_EXPANDO|D_NOT_EMPTY, IP "%u%D%I %t%4n %T%d %> [%.7m/%.10M, %.6e%<C?, %C>, %s] ", IP &AttachFormatDef, NULL,
374 "printf-like format string for the attachment menu"
375 },
376 { "auto_edit", DT_BOOL, false, 0, NULL,
377 "Skip the initial compose menu and edit the email"
378 },
379 { "auto_tag", DT_BOOL, false, 0, NULL,
380 "Automatically apply actions to all tagged messages"
381 },
382 { "braille_friendly", DT_BOOL, false, 0, NULL,
383 "Move the cursor to the beginning of the line"
384 },
386 "Default character set for displaying text on screen"
387 },
388 { "color_directcolor", DT_BOOL|D_ON_STARTUP, false, 0, NULL,
389 "Use 24bit colors (aka truecolor aka directcolor)"
390 },
391 { "config_charset", DT_STRING, 0, 0, charset_validator,
392 "Character set that the config files are in"
393 },
394 { "confirm_append", DT_BOOL, true, 0, NULL,
395 "Confirm before appending emails to a mailbox"
396 },
397 { "confirm_create", DT_BOOL, true, 0, NULL,
398 "Confirm before creating a new mailbox"
399 },
400 { "copy_decode_weed", DT_BOOL, false, 0, NULL,
401 "Controls whether to weed headers when copying or saving emails"
402 },
403 { "date_format", DT_STRING|D_NOT_EMPTY, IP "!%a, %b %d, %Y at %I:%M:%S%p %Z", 0, NULL,
404 "strftime format string for the `%d` expando"
405 },
406 { "debug_file", DT_PATH|D_PATH_FILE, IP "~/.neomuttdebug", 0, NULL,
407 "File to save debug logs"
408 },
409 { "debug_level", DT_NUMBER, 0, 0, debug_level_validator,
410 "Logging level for debug logs"
411 },
412 { "delete", DT_QUAD, MUTT_ASKYES, 0, NULL,
413 "Really delete messages, when the mailbox is closed"
414 },
415 { "delete_untag", DT_BOOL, true, 0, NULL,
416 "Untag messages when they are marked for deletion"
417 },
418 { "editor", DT_STRING|D_NOT_EMPTY|D_STRING_COMMAND, 0, 0, NULL,
419 "External command to use as an email editor"
420 },
421 { "flag_safe", DT_BOOL, false, 0, NULL,
422 "Protect flagged messages from deletion"
423 },
424 { "folder", DT_STRING|D_STRING_MAILBOX, IP "~/Mail", 0, NULL,
425 "Base folder for a set of mailboxes"
426 },
427 { "forward_decode", DT_BOOL, true, 0, NULL,
428 "Decode the message when forwarding it"
429 },
430 { "forward_quote", DT_BOOL, false, 0, NULL,
431 "Automatically quote a forwarded message using `$indent_string`"
432 },
433 { "from", DT_ADDRESS, 0, 0, NULL,
434 "Default 'From' address to use, if isn't otherwise set"
435 },
436 { "gecos_mask", DT_REGEX, IP "^[^,]*", 0, NULL,
437 "Regex for parsing GECOS field of /etc/passwd"
438 },
439 { "header", DT_BOOL, false, 0, NULL,
440 "Include the message headers in the reply email (Weed applies)"
441 },
442 { "hostname", DT_STRING, 0, 0, NULL,
443 "Fully-qualified domain name of this machine"
444 },
445 { "indent_string", DT_EXPANDO, IP "> ", IP IndexFormatDefNoPadding, NULL,
446 "String used to indent 'reply' text"
447 },
448 { "keep_flagged", DT_BOOL, false, 0, NULL,
449 "Don't move flagged messages from `$spool_file` to `$mbox`"
450 },
451 { "local_date_header", DT_BOOL, true, 0, NULL,
452 "Convert the date in the Date header of sent emails into local timezone, UTC otherwise"
453 },
454 { "mail_check", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 5, 0, NULL,
455 "Number of seconds before NeoMutt checks for new mail"
456 },
457 { "mail_check_recent", DT_BOOL, true, 0, NULL,
458 "Notify the user about new mail since the last time the mailbox was opened"
459 },
460 { "mail_check_stats", DT_BOOL, false, 0, NULL,
461 "Periodically check for new mail"
462 },
463 { "mail_check_stats_interval", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 60, 0, NULL,
464 "How often to check for new mail"
465 },
466 { "mark_old", DT_BOOL, true, 0, NULL,
467 "Mark new emails as old when leaving the mailbox"
468 },
469 { "mbox", DT_STRING|D_STRING_MAILBOX, IP "~/mbox", 0, NULL,
470 "Folder that receives read emails (see Move)"
471 },
472 { "mbox_type", DT_ENUM, MUTT_MBOX, IP &MboxTypeDef, NULL,
473 "Default type for creating new mailboxes"
474 },
475 { "message_cache_clean", DT_BOOL, false, 0, NULL,
476 "(imap/pop) Clean out obsolete entries from the message cache"
477 },
478 { "message_cache_dir", DT_PATH|D_PATH_DIR, 0, 0, NULL,
479 "(imap/pop) Directory for the message cache"
480 },
481 { "meta_key", DT_BOOL, false, 0, NULL,
482 "Interpret 'ALT-x' as 'ESC-x'"
483 },
484 { "move", DT_QUAD, MUTT_NO, 0, NULL,
485 "Move emails from `$spool_file` to `$mbox` when read"
486 },
487 { "pipe_decode", DT_BOOL, false, 0, NULL,
488 "Decode the message when piping it"
489 },
490 { "pipe_decode_weed", DT_BOOL, true, 0, NULL,
491 "Control whether to weed headers when piping an email"
492 },
493 { "pipe_sep", DT_STRING, IP "\n", 0, NULL,
494 "Separator to add between multiple piped messages"
495 },
496 { "pipe_split", DT_BOOL, false, 0, NULL,
497 "Run the pipe command on each message separately"
498 },
499 { "postponed", DT_STRING|D_STRING_MAILBOX, IP "~/postponed", 0, NULL,
500 "Folder to store postponed messages"
501 },
502 { "print", DT_QUAD, MUTT_ASKNO, 0, NULL,
503 "Confirm before printing a message"
504 },
505 { "print_command", DT_STRING|D_STRING_COMMAND, IP "lpr", 0, NULL,
506 "External command to print a message"
507 },
508 { "print_decode", DT_BOOL, true, 0, NULL,
509 "Decode message before printing it"
510 },
511 { "print_decode_weed", DT_BOOL, true, 0, NULL,
512 "Control whether to weed headers when printing an email"
513 },
514 { "print_split", DT_BOOL, false, 0, NULL,
515 "Print multiple messages separately"
516 },
517 { "quote_regex", DT_REGEX, IP "^([ \t]*[|>:}#])+", 0, NULL,
518 "Regex to match quoted text in a reply"
519 },
520 { "real_name", DT_STRING, 0, 0, NULL,
521 "Real name of the user"
522 },
523 { "record", DT_STRING|D_STRING_MAILBOX, IP "~/sent", 0, NULL,
524 "Folder to save 'sent' messages"
525 },
526 { "resolve", DT_BOOL, true, 0, NULL,
527 "Move to the next email whenever a command modifies an email"
528 },
529 { "resume_edited_draft_files", DT_BOOL, true, 0, NULL,
530 "Resume editing previously saved draft files"
531 },
532 { "save_address", DT_BOOL, false, 0, NULL,
533 "Use sender's full address as a default save folder"
534 },
535 { "save_empty", DT_BOOL, true, 0, NULL,
536 "(mbox,mmdf) Preserve empty mailboxes"
537 },
538 { "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,
539 "Character sets for outgoing mail"
540 },
541 { "shell", DT_STRING|D_STRING_COMMAND, IP "/bin/sh", 0, NULL,
542 "External command to run subshells in"
543 },
544 { "size_show_bytes", DT_BOOL, false, 0, NULL,
545 "Show smaller sizes in bytes"
546 },
547 { "size_show_fractions", DT_BOOL, true, 0, NULL,
548 "Show size fractions with a single decimal place"
549 },
550 { "size_show_mb", DT_BOOL, true, 0, NULL,
551 "Show sizes in megabytes for sizes greater than 1 megabyte"
552 },
553 { "size_units_on_left", DT_BOOL, false, 0, NULL,
554 "Show the units as a prefix to the size"
555 },
556 { "sleep_time", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 1, 0, NULL,
557 "Time to pause after certain info messages"
558 },
560 "Sort method for the index"
561 },
563 "Secondary sort method for the index"
564 },
565 { "spool_file", DT_STRING|D_STRING_MAILBOX, 0, 0, NULL,
566 "Inbox"
567 },
568 { "status_on_top", DT_BOOL, false, 0, NULL,
569 "Display the status bar at the top"
570 },
571 { "suspend", DT_BOOL, true, 0, NULL,
572 "Allow the user to suspend NeoMutt using '^Z'"
573 },
574 { "text_flowed", DT_BOOL, false, 0, NULL,
575 "Generate 'format=flowed' messages"
576 },
577 { "timeout", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 600, 0, NULL,
578 "Time to wait for user input in menus"
579 },
580 { "tmp_dir", DT_PATH|D_PATH_DIR|D_NOT_EMPTY, IP TMPDIR, 0, NULL,
581 "Directory for temporary files"
582 },
583 { "trash", DT_STRING|D_STRING_MAILBOX, 0, 0, NULL,
584 "Folder to put deleted emails"
585 },
586 { "use_domain", DT_BOOL, true, 0, NULL,
587 "Qualify local addresses using this domain"
588 },
589 { "use_threads", DT_ENUM, UT_UNSET, IP &UseThreadsTypeDef, NULL,
590 "Whether to use threads for the index"
591 },
592 { "wait_key", DT_BOOL, true, 0, NULL,
593 "Prompt to press a key after running external commands"
594 },
595 { "weed", DT_BOOL, true, 0, NULL,
596 "Filter headers when displaying/forwarding/printing/replying"
597 },
598 { "wrap", DT_NUMBER, 0, 0, NULL,
599 "Width to wrap text in the pager"
600 },
601 { "wrap_search", DT_BOOL, true, 0, NULL,
602 "Wrap around when the search hits the end"
603 },
604
605 { "cursor_overlay", D_INTERNAL_DEPRECATED|DT_BOOL, 0, IP "2020-07-20" },
606 { "escape", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2021-03-18" },
607 { "ignore_linear_white_space", D_INTERNAL_DEPRECATED|DT_BOOL, 0, IP "2021-03-18" },
608 { "mixmaster", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2024-05-30" },
609 { "mix_entry_format", D_INTERNAL_DEPRECATED|DT_EXPANDO,0, IP "2024-05-30" },
610 { "visual", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2021-03-18" },
611
612 { "autoedit", DT_SYNONYM, IP "auto_edit", IP "2021-03-21" },
613 { "confirmappend", DT_SYNONYM, IP "confirm_append", IP "2021-03-21" },
614 { "confirmcreate", DT_SYNONYM, IP "confirm_create", IP "2021-03-21" },
615 { "forw_decode", DT_SYNONYM, IP "forward_decode", IP "2021-03-21" },
616 { "forw_quote", DT_SYNONYM, IP "forward_quote", IP "2021-03-21" },
617 { "indent_str", DT_SYNONYM, IP "indent_string", IP "2021-03-21" },
618 { "message_cachedir", DT_SYNONYM, IP "message_cache_dir", IP "2023-01-25" },
619 { "print_cmd", DT_SYNONYM, IP "print_command", IP "2021-03-21" },
620 { "quote_regexp", DT_SYNONYM, IP "quote_regex", IP "2021-03-21" },
621 { "realname", DT_SYNONYM, IP "real_name", IP "2021-03-21" },
622 { "spoolfile", DT_SYNONYM, IP "spool_file", IP "2021-03-21" },
623 { "tmpdir", DT_SYNONYM, IP "tmp_dir", IP "2023-01-25" },
624
625 { "devel_security", DT_BOOL, false, 0, NULL,
626 "Devel feature: Security -- https://github.com/neomutt/neomutt/discussions/4251"
627 },
628
629 { NULL },
630 // clang-format on
631};
#define IP
Definition set.h:54
@ MUTT_MBOX
'mbox' Mailbox type
Definition mailbox.h:44
@ EMAIL_SORT_DATE
Sort by the date the email was sent.
Definition sort.h:54
const struct Mapping SortMethods[]
Sort methods for '$sort' for the index.
Definition mutt_config.c:77
int sort_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "sort" config variable - Implements ConfigDef::validator() -.
Definition thread.c:105
int charset_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "charset" config variables - Implements ConfigDef::validator() -.
Definition charset.c:45
int charset_slist_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the multiple "charset" config variables - Implements ConfigDef::validator() -.
Definition charset.c:84
int debug_level_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "debug_level" config variable - Implements ConfigDef::validator() -.
const struct EnumDef UseThreadsTypeDef
Data for the $use_threads enumeration.
Definition thread.c:64
@ UT_UNSET
Not yet set by user, stick to legacy semantics.
Definition thread.h:97
static const struct ExpandoDefinition *const IndexFormatDefNoPadding
IndexFormatDefNoPadding - Index format definitions, without padding.
static const struct Mapping SortAuxMethods[]
Sort methods for '$sort_aux' for the index.
Definition mutt_config.c:54
static const struct ExpandoDefinition AttachFormatDef[]
Expando definitions.
const struct EnumDef MboxTypeDef
Data for the $mbox_type enumeration.
Definition mx.c:89
@ 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
#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_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:38
@ DT_SLIST
a list of strings
Definition types.h:42
@ DT_BOOL
boolean option
Definition types.h:32
@ DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition types.h:40
@ DT_SYNONYM
synonym for another variable
Definition types.h:45
@ DT_STRING
a string
Definition types.h:44
@ DT_SORT
sorting methods
Definition types.h:43
@ DT_ADDRESS
e-mail address
Definition types.h:31
@ DT_EXPANDO
an expando
Definition types.h:34
@ DT_ENUM
an enumeration
Definition types.h:33
@ DT_REGEX
regular expressions
Definition types.h:41
@ DT_PATH
a path to a file/directory
Definition types.h:39
#define D_STRING_MAILBOX
Don't perform path expansions.
Definition types.h: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

◆ ModuleMain

const struct Module ModuleMain
Initial value:
= {
"main",
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
static bool main_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:40
@ MODULE_ID_MAIN
ModuleMain, NeoMutt Email Client
Definition module_api.h:44

Module for the Main library.

Definition at line 48 of file module.c.

48 {
50 "main",
51 NULL, // init
52 NULL, // config_define_types
54 NULL, // commands_register
55 NULL, // gui_init
56 NULL, // gui_cleanup
57 NULL, // cleanup
58};