NeoMutt
2025-12-11-1039-g550ac6
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
24
30
31
#include "config.h"
32
#include <stdbool.h>
33
#include <stddef.h>
34
#include "
private.h
"
35
#include "
mutt/lib.h
"
36
#include "
config/lib.h
"
37
#include "
expando/lib.h
"
38
#include "
sort.h
"
39
43
static
const
struct
Mapping
SidebarSortMethods
[] = {
44
// clang-format off
45
{
"count"
,
SB_SORT_COUNT
},
46
{
"desc"
,
SB_SORT_DESC
},
47
{
"flagged"
,
SB_SORT_FLAGGED
},
48
{
"path"
,
SB_SORT_PATH
},
49
{
"unread"
,
SB_SORT_UNREAD
},
50
{
"unsorted"
,
SB_SORT_UNSORTED
},
51
// Compatibility
52
{
"alpha"
,
SB_SORT_PATH
},
53
{
"mailbox-order"
,
SB_SORT_UNSORTED
},
54
{
"name"
,
SB_SORT_PATH
},
55
{
"new"
,
SB_SORT_UNREAD
},
56
{ NULL, 0 },
57
// clang-format on
58
};
59
66
static
const
struct
ExpandoDefinition
SidebarFormatDef
[] = {
67
// clang-format off
68
{
"*"
,
"padding-soft"
,
ED_GLOBAL
,
ED_GLO_PADDING_SOFT
,
node_padding_parse
},
69
{
">"
,
"padding-hard"
,
ED_GLOBAL
,
ED_GLO_PADDING_HARD
,
node_padding_parse
},
70
{
"|"
,
"padding-eol"
,
ED_GLOBAL
,
ED_GLO_PADDING_EOL
,
node_padding_parse
},
71
{
"!"
,
"flagged"
,
ED_SIDEBAR
,
ED_SID_FLAGGED
, NULL },
72
{
"a"
,
"notify"
,
ED_SIDEBAR
,
ED_SID_NOTIFY
, NULL },
73
{
"B"
,
"name"
,
ED_SIDEBAR
,
ED_SID_NAME
, NULL },
74
{
"d"
,
"deleted-count"
,
ED_SIDEBAR
,
ED_SID_DELETED_COUNT
, NULL },
75
{
"D"
,
"description"
,
ED_SIDEBAR
,
ED_SID_DESCRIPTION
, NULL },
76
{
"f"
,
"fuzzy-score"
,
ED_SIDEBAR
,
ED_SID_FUZZY_SCORE
, NULL },
77
{
"F"
,
"flagged-count"
,
ED_SIDEBAR
,
ED_SID_FLAGGED_COUNT
, NULL },
78
{
"i"
,
"number"
,
ED_SIDEBAR
,
ED_SID_NUMBER
, NULL },
79
{
"L"
,
"limited-count"
,
ED_SIDEBAR
,
ED_SID_LIMITED_COUNT
, NULL },
80
{
"n"
,
"new-mail"
,
ED_SIDEBAR
,
ED_SID_NEW_MAIL
, NULL },
81
{
"N"
,
"unread-count"
,
ED_SIDEBAR
,
ED_SID_UNREAD_COUNT
, NULL },
82
{
"o"
,
"old-count"
,
ED_SIDEBAR
,
ED_SID_OLD_COUNT
, NULL },
83
{
"p"
,
"poll"
,
ED_SIDEBAR
,
ED_SID_POLL
, NULL },
84
{
"r"
,
"read-count"
,
ED_SIDEBAR
,
ED_SID_READ_COUNT
, NULL },
85
{
"S"
,
"message-count"
,
ED_SIDEBAR
,
ED_SID_MESSAGE_COUNT
, NULL },
86
{
"t"
,
"tagged-count"
,
ED_SIDEBAR
,
ED_SID_TAGGED_COUNT
, NULL },
87
{
"Z"
,
"unseen-count"
,
ED_SIDEBAR
,
ED_SID_UNSEEN_COUNT
, NULL },
88
{ NULL, NULL, 0, -1, NULL }
89
// clang-format on
90
};
91
95
struct
ConfigDef
SidebarVars
[] = {
96
// clang-format off
97
{
"sidebar_component_depth"
,
DT_NUMBER
, 0, 0, NULL,
98
"(sidebar) Strip leading path components from sidebar folders"
99
},
100
{
"sidebar_delim_chars"
,
DT_STRING
,
IP
"/."
, 0, NULL,
101
"(sidebar) Characters that separate nested folders"
102
},
103
{
"sidebar_divider_char"
,
DT_STRING
,
IP
"\342\224\202"
, 0, NULL,
// Box Drawings Light Vertical, U+2502
104
"(sidebar) Character to draw between the sidebar and index"
105
},
106
{
"sidebar_folder_indent"
,
DT_BOOL
,
false
, 0, NULL,
107
"(sidebar) Indent nested folders"
108
},
109
{
"sidebar_format"
,
DT_EXPANDO
|
D_NOT_EMPTY
,
IP
"%D%* %n"
,
IP
&
SidebarFormatDef
, NULL,
110
"(sidebar) printf-like format string for the sidebar panel"
111
},
112
{
"sidebar_indent_string"
,
DT_STRING
,
IP
" "
, 0, NULL,
113
"(sidebar) Indent nested folders using this string"
114
},
115
{
"sidebar_new_mail_only"
,
DT_BOOL
,
false
, 0, NULL,
116
"(sidebar) Only show folders with new/flagged mail"
117
},
118
{
"sidebar_next_new_wrap"
,
DT_BOOL
,
false
, 0, NULL,
119
"(sidebar) Wrap around when searching for the next mailbox with new mail"
120
},
121
{
"sidebar_non_empty_mailbox_only"
,
DT_BOOL
,
false
, 0, NULL,
122
"(sidebar) Only show folders with a non-zero number of mail"
123
},
124
{
"sidebar_on_right"
,
DT_BOOL
,
false
, 0, NULL,
125
"(sidebar) Display the sidebar on the right"
126
},
127
{
"sidebar_short_path"
,
DT_BOOL
,
false
, 0, NULL,
128
"(sidebar) Abbreviate the paths using the `$folder` variable"
129
},
130
{
"sidebar_sort"
,
DT_SORT
,
SB_SORT_UNSORTED
,
IP
SidebarSortMethods
, NULL,
131
"(sidebar) Method to sort the sidebar"
132
},
133
{
"sidebar_visible"
,
DT_BOOL
,
false
, 0, NULL,
134
"(sidebar) Show the sidebar"
135
},
136
{
"sidebar_width"
,
DT_NUMBER
|
D_INTEGER_NOT_NEGATIVE
, 30, 0, NULL,
137
"(sidebar) Width of the sidebar"
138
},
139
140
{
"sidebar_sort_method"
,
DT_SYNONYM
,
IP
"sidebar_sort"
,
IP
"2024-11-20"
},
141
142
{ NULL },
143
// clang-format on
144
};
lib.h
Convenience wrapper for the config headers.
IP
#define IP
Definition
set.h:55
ED_SIDEBAR
@ ED_SIDEBAR
Sidebar ED_SID_ ExpandoDataSidebar.
Definition
domain.h:55
ED_GLOBAL
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition
domain.h:44
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
lib.h
Convenience wrapper for the library headers.
SidebarVars
struct ConfigDef SidebarVars[]
Config definitions for the sidebar.
Definition
config.c:95
SidebarSortMethods
static const struct Mapping SidebarSortMethods[]
Sort methods for the sidebar.
Definition
config.c:43
SidebarFormatDef
static const struct ExpandoDefinition SidebarFormatDef[]
Expando definitions.
Definition
config.c:66
private.h
GUI display the mailboxes in a side panel.
ED_SID_FLAGGED_COUNT
@ ED_SID_FLAGGED_COUNT
Mailbox.msg_flagged.
Definition
private.h:61
ED_SID_FUZZY_SCORE
@ ED_SID_FUZZY_SCORE
SbEntry.score.
Definition
private.h:65
ED_SID_READ_COUNT
@ ED_SID_READ_COUNT
Mailbox.msg_count, Mailbox.msg_unread.
Definition
private.h:71
ED_SID_DESCRIPTION
@ ED_SID_DESCRIPTION
Mailbox.name.
Definition
private.h:59
ED_SID_NEW_MAIL
@ ED_SID_NEW_MAIL
Mailbox.has_new.
Definition
private.h:66
ED_SID_UNSEEN_COUNT
@ ED_SID_UNSEEN_COUNT
Mailbox.msg_new.
Definition
private.h:74
ED_SID_POLL
@ ED_SID_POLL
Mailbox.poll_new_mail.
Definition
private.h:70
ED_SID_OLD_COUNT
@ ED_SID_OLD_COUNT
Mailbox.msg_unread, Mailbox.msg_new.
Definition
private.h:69
ED_SID_MESSAGE_COUNT
@ ED_SID_MESSAGE_COUNT
Mailbox.msg_count.
Definition
private.h:63
ED_SID_LIMITED_COUNT
@ ED_SID_LIMITED_COUNT
Mailbox.vcount.
Definition
private.h:62
ED_SID_UNREAD_COUNT
@ ED_SID_UNREAD_COUNT
Mailbox.msg_unread.
Definition
private.h:73
ED_SID_TAGGED_COUNT
@ ED_SID_TAGGED_COUNT
Mailbox.msg_tagged.
Definition
private.h:72
ED_SID_NUMBER
@ ED_SID_NUMBER
SbEntry number (line).
Definition
private.h:68
ED_SID_NOTIFY
@ ED_SID_NOTIFY
Mailbox.notify_user.
Definition
private.h:67
ED_SID_NAME
@ ED_SID_NAME
SbEntry.box.
Definition
private.h:64
ED_SID_DELETED_COUNT
@ ED_SID_DELETED_COUNT
Mailbox.msg_deleted.
Definition
private.h:58
ED_SID_FLAGGED
@ ED_SID_FLAGGED
Mailbox.msg_flagged.
Definition
private.h:60
sort.h
Sidebar sorting functions.
SB_SORT_FLAGGED
@ SB_SORT_FLAGGED
Sort by count of flagged messages.
Definition
sort.h:33
SB_SORT_COUNT
@ SB_SORT_COUNT
Sort by total message count.
Definition
sort.h:31
SB_SORT_DESC
@ SB_SORT_DESC
Sort by mailbox description.
Definition
sort.h:32
SB_SORT_PATH
@ SB_SORT_PATH
Sort by mailbox path (alphabetically).
Definition
sort.h:34
SB_SORT_UNREAD
@ SB_SORT_UNREAD
Sort by count of unread messages.
Definition
sort.h:35
SB_SORT_UNSORTED
@ SB_SORT_UNSORTED
Sort into the order the mailboxes were configured.
Definition
sort.h:36
ConfigDef
Definition
set.h:65
ExpandoDefinition
Definition of a format string.
Definition
definition.h:49
Mapping
Mapping between user-readable string and a constant.
Definition
mapping.h:33
DT_NUMBER
@ DT_NUMBER
a number
Definition
types.h:38
DT_BOOL
@ DT_BOOL
boolean option
Definition
types.h:32
DT_SYNONYM
@ DT_SYNONYM
synonym for another variable
Definition
types.h:45
DT_STRING
@ DT_STRING
a string
Definition
types.h:44
DT_SORT
@ DT_SORT
sorting methods
Definition
types.h:43
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
D_INTEGER_NOT_NEGATIVE
#define D_INTEGER_NOT_NEGATIVE
Negative numbers are not allowed.
Definition
types.h:101
ED_GLO_PADDING_EOL
@ ED_GLO_PADDING_EOL
Padding to end-of-line.
Definition
uid.h:38
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