NeoMutt  2025-12-11-911-gd8d604
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()
 
static bool main_gui_init (struct NeoMutt *n)
 Initialise the GUI - Implements Module::gui_init()
 
static void main_gui_cleanup (struct NeoMutt *n)
 Clean up the GUI - Implements Module::gui_cleanup()
 

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:

◆ main_gui_init()

static bool main_gui_init ( struct NeoMutt * n)
static

Initialise the GUI - Implements Module::gui_init()

Definition at line 48 of file module.c.

49{
50 return true;
51}

◆ main_gui_cleanup()

static void main_gui_cleanup ( struct NeoMutt * n)
static

Clean up the GUI - Implements Module::gui_cleanup()

Definition at line 56 of file module.c.

57{
58}

Variable Documentation

◆ MainVars

struct ConfigDef MainVars[]
extern

General Config definitions for NeoMutt.

Definition at line 378 of file mutt_config.c.

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

Module for the Main library.

Definition at line 63 of file module.c.

63 {
65 "main",
66 NULL, // init
67 NULL, // config_define_types
69 NULL, // commands_register
72 NULL, // cleanup
73};