NeoMutt
2025-12-11-1040-g5187ba
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
config.c
Go to the documentation of this file.
1
22
28
29
#include "config.h"
30
#include <stdbool.h>
31
#include <stddef.h>
32
#include "
mutt/lib.h
"
33
#include "
config/lib.h
"
34
#include "
expando/lib.h
"
35
#include "
menu/lib.h
"
36
#include "
shared_data.h
"
37
38
extern
const
struct
ExpandoDefinition
IndexFormatDef
[];
39
49
const
struct
ExpandoDefinition
StatusFormatDef
[] = {
50
// clang-format off
51
{
"*"
,
"padding-soft"
,
ED_GLOBAL
,
ED_GLO_PADDING_SOFT
,
node_padding_parse
},
52
{
">"
,
"padding-hard"
,
ED_GLOBAL
,
ED_GLO_PADDING_HARD
,
node_padding_parse
},
53
{
"|"
,
"padding-eol"
,
ED_GLOBAL
,
ED_GLO_PADDING_EOL
,
node_padding_parse
},
54
{
"b"
,
"unread-mailboxes"
,
ED_INDEX
,
ED_IND_UNREAD_MAILBOXES
, NULL },
55
{
"d"
,
"deleted-count"
,
ED_INDEX
,
ED_IND_DELETED_COUNT
, NULL },
56
{
"D"
,
"description"
,
ED_INDEX
,
ED_IND_DESCRIPTION
, NULL },
57
{
"f"
,
"mailbox-path"
,
ED_INDEX
,
ED_IND_MAILBOX_PATH
, NULL },
58
{
"F"
,
"flagged-count"
,
ED_INDEX
,
ED_IND_FLAGGED_COUNT
, NULL },
59
{
"h"
,
"hostname"
,
ED_GLOBAL
,
ED_GLO_HOSTNAME
, NULL },
60
{
"l"
,
"mailbox-size"
,
ED_INDEX
,
ED_IND_MAILBOX_SIZE
, NULL },
61
{
"L"
,
"limit-size"
,
ED_INDEX
,
ED_IND_LIMIT_SIZE
, NULL },
62
{
"m"
,
"message-count"
,
ED_INDEX
,
ED_IND_MESSAGE_COUNT
, NULL },
63
{
"M"
,
"limit-count"
,
ED_INDEX
,
ED_IND_LIMIT_COUNT
, NULL },
64
{
"n"
,
"new-count"
,
ED_INDEX
,
ED_IND_NEW_COUNT
, NULL },
65
{
"o"
,
"old-count"
,
ED_INDEX
,
ED_IND_OLD_COUNT
, NULL },
66
{
"p"
,
"postponed-count"
,
ED_INDEX
,
ED_IND_POSTPONED_COUNT
, NULL },
67
{
"P"
,
"percentage"
,
ED_MENU
,
ED_MEN_PERCENTAGE
, NULL },
68
{
"r"
,
"readonly"
,
ED_INDEX
,
ED_IND_READONLY
, NULL },
69
{
"R"
,
"read-count"
,
ED_INDEX
,
ED_IND_READ_COUNT
, NULL },
70
{
"s"
,
"sort"
,
ED_GLOBAL
,
ED_GLO_CONFIG_SORT
, NULL },
71
{
"S"
,
"sort-aux"
,
ED_GLOBAL
,
ED_GLO_CONFIG_SORT_AUX
, NULL },
72
{
"t"
,
"tagged-count"
,
ED_INDEX
,
ED_IND_TAGGED_COUNT
, NULL },
73
{
"T"
,
"use-threads"
,
ED_GLOBAL
,
ED_GLO_CONFIG_USE_THREADS
, NULL },
74
{
"u"
,
"unread-count"
,
ED_INDEX
,
ED_IND_UNREAD_COUNT
, NULL },
75
{
"v"
,
"version"
,
ED_GLOBAL
,
ED_GLO_VERSION
, NULL },
76
{
"V"
,
"limit-pattern"
,
ED_INDEX
,
ED_IND_LIMIT_PATTERN
, NULL },
77
{ NULL, NULL, 0, -1, NULL }
78
// clang-format on
79
};
80
82
static
const
struct
ExpandoDefinition
*
const
StatusFormatDefNoPadding
= &(
StatusFormatDef
[3]);
83
87
struct
ConfigDef
IndexVars
[] = {
88
// clang-format off
89
{
"beep_new"
,
DT_BOOL
,
false
, 0, NULL,
90
"Make a noise when new mail arrives"
91
},
92
{
"change_folder_next"
,
DT_BOOL
,
false
, 0, NULL,
93
"Suggest the next folder, rather than the first when using '<change-folder>'"
94
},
95
{
"collapse_all"
,
DT_BOOL
,
false
, 0, NULL,
96
"Collapse all threads when entering a folder"
97
},
98
{
"crypt_chars"
,
DT_MBTABLE
,
IP
"SPsK "
, 0, NULL,
99
"User-configurable crypto flags: signed, encrypted etc."
100
},
101
{
"flag_chars"
,
DT_MBTABLE
,
IP
"*!DdrONon- "
, 0, NULL,
102
"User-configurable index flags: tagged, new, etc"
103
},
104
{
"from_chars"
,
DT_MBTABLE
, 0, 0, NULL,
105
"User-configurable index flags: to address, cc address, etc"
106
},
107
{
"index_format"
,
DT_EXPANDO
|
D_NOT_EMPTY
,
IP
"%4C %Z %{%b %d} %-15.15L (%<l?%4l&%4c>) %s"
,
IP
&
IndexFormatDef
, NULL,
108
"printf-like format string for the index menu (emails)"
109
},
110
{
"mark_macro_prefix"
,
DT_STRING
,
IP
"'"
, 0, NULL,
111
"Prefix for macros using '<mark-message>'"
112
},
113
{
"new_mail_command"
,
DT_EXPANDO
|
D_STRING_COMMAND
, 0,
IP
StatusFormatDefNoPadding
, NULL,
114
"External command to run when new mail arrives"
115
},
116
{
"quit"
,
DT_QUAD
,
MUTT_YES
, 0, NULL,
117
"Prompt before exiting NeoMutt"
118
},
119
{
"read_only"
,
DT_BOOL
,
false
, 0, NULL,
120
"Open folders in read-only mode"
121
},
122
// L10N: $status_format default format
123
{
"status_format"
,
DT_EXPANDO
|
D_L10N_STRING
,
IP
N_
(
"-%r-NeoMutt: %D [Msgs:%<M?%M/>%m%<n? New:%n>%<o? Old:%o>%<d? Del:%d>%<F? Flag:%F>%<t? Tag:%t>%<p? Post:%p>%<b? Inc:%b>%<l? %l>]---(%<T?%T/>%s/%S)-%>-(%P)---"
),
IP
&
StatusFormatDef
, NULL,
124
"printf-like format string for the index's status line"
125
},
126
{
"status_chars"
,
DT_MBTABLE
,
IP
"-*%A"
, 0, NULL,
127
"Indicator characters for the status bar"
128
},
129
{
"to_chars"
,
DT_MBTABLE
,
IP
" +TCFLR"
, 0, NULL,
130
"Indicator characters for the 'To' field in the index"
131
},
132
{
"ts_enabled"
,
DT_BOOL
,
false
, 0, NULL,
133
"Allow NeoMutt to set the terminal status line and icon"
134
},
135
// L10N: $ts_icon_format default format
136
{
"ts_icon_format"
,
DT_EXPANDO
|
D_L10N_STRING
,
IP
N_
(
"M%<n?AIL&ail>"
),
IP
StatusFormatDefNoPadding
, NULL,
137
"printf-like format string for the terminal's icon title"
138
},
139
// L10N: $ts_status_format default format
140
{
"ts_status_format"
,
DT_EXPANDO
|
D_L10N_STRING
,
IP
N_
(
"NeoMutt with %<m?%m messages&no messages>%<n? [%n NEW]>"
),
IP
StatusFormatDefNoPadding
, NULL,
141
"printf-like format string for the terminal's status (window title)"
142
},
143
{
"uncollapse_jump"
,
DT_BOOL
,
false
, 0, NULL,
144
"When opening a thread, jump to the next unread message"
145
},
146
{
"uncollapse_new"
,
DT_BOOL
,
true
, 0, NULL,
147
"Open collapsed threads when new mail arrives"
148
},
149
150
{
"hdr_format"
,
DT_SYNONYM
,
IP
"index_format"
,
IP
"2021-03-21"
},
151
{
"xterm_icon"
,
DT_SYNONYM
,
IP
"ts_icon_format"
,
IP
"2021-03-21"
},
152
{
"xterm_set_titles"
,
DT_SYNONYM
,
IP
"ts_enabled"
,
IP
"2021-03-21"
},
153
{
"xterm_title"
,
DT_SYNONYM
,
IP
"ts_status_format"
,
IP
"2021-03-21"
},
154
155
{ NULL },
156
// clang-format on
157
};
IndexFormatDef
const struct ExpandoDefinition IndexFormatDef[]
Expando definitions.
Definition
mutt_config.c:312
lib.h
Convenience wrapper for the config headers.
IP
#define IP
Definition
set.h:55
ED_MENU
@ ED_MENU
Menu ED_MEN_ ExpandoDataMenu.
Definition
domain.h:48
ED_GLOBAL
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition
domain.h:44
ED_INDEX
@ ED_INDEX
Index ED_IND_ ExpandoDataIndex.
Definition
domain.h:46
lib.h
Parse Expando string.
node_padding_parse
struct ExpandoNode * node_padding_parse(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Padding Expando - Implements ExpandoDefinition::parse() -.
Definition
node_padding.c:234
StatusFormatDef
const struct ExpandoDefinition StatusFormatDef[]
Expando definitions.
Definition
config.c:49
IndexVars
struct ConfigDef IndexVars[]
Config definitions for the Index.
Definition
config.c:87
StatusFormatDefNoPadding
static const struct ExpandoDefinition *const StatusFormatDefNoPadding
StatusFormatDefNoPadding - Status format definitions, without padding.
Definition
config.c:82
shared_data.h
Data shared between Index, Pager and Sidebar.
ED_IND_LIMIT_COUNT
@ ED_IND_LIMIT_COUNT
Mailbox.vcount.
Definition
shared_data.h:59
ED_IND_MAILBOX_PATH
@ ED_IND_MAILBOX_PATH
Mailbox.pathbuf, Mailbox.name.
Definition
shared_data.h:62
ED_IND_DELETED_COUNT
@ ED_IND_DELETED_COUNT
Mailbox.msg_deleted.
Definition
shared_data.h:56
ED_IND_NEW_COUNT
@ ED_IND_NEW_COUNT
Mailbox.msg_new.
Definition
shared_data.h:65
ED_IND_MAILBOX_SIZE
@ ED_IND_MAILBOX_SIZE
Mailbox.size.
Definition
shared_data.h:63
ED_IND_LIMIT_PATTERN
@ ED_IND_LIMIT_PATTERN
MailboxView.pattern.
Definition
shared_data.h:60
ED_IND_READ_COUNT
@ ED_IND_READ_COUNT
Mailbox.msg_count, Mailbox.msg_unread.
Definition
shared_data.h:69
ED_IND_POSTPONED_COUNT
@ ED_IND_POSTPONED_COUNT
mutt_num_postponed()
Definition
shared_data.h:67
ED_IND_FLAGGED_COUNT
@ ED_IND_FLAGGED_COUNT
Mailbox.msg_flagged.
Definition
shared_data.h:58
ED_IND_MESSAGE_COUNT
@ ED_IND_MESSAGE_COUNT
Mailbox.msg_count.
Definition
shared_data.h:64
ED_IND_OLD_COUNT
@ ED_IND_OLD_COUNT
Mailbox.msg_unread, Mailbox.msg_new.
Definition
shared_data.h:66
ED_IND_READONLY
@ ED_IND_READONLY
Mailbox.readonly, Mailbox.dontwrite.
Definition
shared_data.h:68
ED_IND_UNREAD_COUNT
@ ED_IND_UNREAD_COUNT
Mailbox.msg_unread.
Definition
shared_data.h:71
ED_IND_TAGGED_COUNT
@ ED_IND_TAGGED_COUNT
Mailbox.msg_tagged.
Definition
shared_data.h:70
ED_IND_LIMIT_SIZE
@ ED_IND_LIMIT_SIZE
MailboxView.vsize.
Definition
shared_data.h:61
ED_IND_DESCRIPTION
@ ED_IND_DESCRIPTION
Mailbox.name.
Definition
shared_data.h:57
ED_IND_UNREAD_MAILBOXES
@ ED_IND_UNREAD_MAILBOXES
Mailbox, mutt_mailbox_check().
Definition
shared_data.h:72
lib.h
GUI present the user with a selectable list.
ED_MEN_PERCENTAGE
@ ED_MEN_PERCENTAGE
Menu.top, ...
Definition
lib.h:75
lib.h
Convenience wrapper for the library headers.
N_
#define N_(a)
Definition
message.h:32
MUTT_YES
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition
quad.h:39
ConfigDef
Definition
set.h:65
ExpandoDefinition
Definition of a format string.
Definition
definition.h:49
D_STRING_COMMAND
#define D_STRING_COMMAND
A command.
Definition
types.h:99
D_L10N_STRING
#define D_L10N_STRING
String can be localised.
Definition
types.h:82
DT_BOOL
@ DT_BOOL
boolean option
Definition
types.h:32
DT_QUAD
@ DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition
types.h:40
DT_SYNONYM
@ DT_SYNONYM
synonym for another variable
Definition
types.h:45
DT_STRING
@ DT_STRING
a string
Definition
types.h:44
DT_MBTABLE
@ DT_MBTABLE
multibyte char table
Definition
types.h:36
DT_EXPANDO
@ DT_EXPANDO
an expando
Definition
types.h:34
D_NOT_EMPTY
#define D_NOT_EMPTY
Empty strings are not allowed.
Definition
types.h:80
ED_GLO_CONFIG_USE_THREADS
@ ED_GLO_CONFIG_USE_THREADS
Value of $use_threads.
Definition
uid.h:36
ED_GLO_PADDING_EOL
@ ED_GLO_PADDING_EOL
Padding to end-of-line.
Definition
uid.h:38
ED_GLO_CONFIG_SORT
@ ED_GLO_CONFIG_SORT
Value of $sort.
Definition
uid.h:34
ED_GLO_VERSION
@ ED_GLO_VERSION
NeoMutt version.
Definition
uid.h:42
ED_GLO_PADDING_HARD
@ ED_GLO_PADDING_HARD
Hard Padding.
Definition
uid.h:39
ED_GLO_PADDING_SOFT
@ ED_GLO_PADDING_SOFT
Soft Padding.
Definition
uid.h:40
ED_GLO_CONFIG_SORT_AUX
@ ED_GLO_CONFIG_SORT_AUX
Value of $sort_aux.
Definition
uid.h:35
ED_GLO_HOSTNAME
@ ED_GLO_HOSTNAME
Local hostname.
Definition
uid.h:37