NeoMutt  2024-12-12-19-ge4b57e
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
config.c
Go to the documentation of this file.
1
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
48 // clang-format off
49 { "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
50 { ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
51 { "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
52 { "b", "unread-mailboxes", ED_INDEX, ED_IND_UNREAD_MAILBOXES, NULL },
53 { "d", "deleted-count", ED_INDEX, ED_IND_DELETED_COUNT, NULL },
54 { "D", "description", ED_INDEX, ED_IND_DESCRIPTION, NULL },
55 { "f", "mailbox-path", ED_INDEX, ED_IND_MAILBOX_PATH, NULL },
56 { "F", "flagged-count", ED_INDEX, ED_IND_FLAGGED_COUNT, NULL },
57 { "h", "hostname", ED_GLOBAL, ED_GLO_HOSTNAME, NULL },
58 { "l", "mailbox-size", ED_INDEX, ED_IND_MAILBOX_SIZE, NULL },
59 { "L", "limit-size", ED_INDEX, ED_IND_LIMIT_SIZE, NULL },
60 { "m", "message-count", ED_INDEX, ED_IND_MESSAGE_COUNT, NULL },
61 { "M", "limit-count", ED_INDEX, ED_IND_LIMIT_COUNT, NULL },
62 { "n", "new-count", ED_INDEX, ED_IND_NEW_COUNT, NULL },
63 { "o", "old-count", ED_INDEX, ED_IND_OLD_COUNT, NULL },
64 { "p", "postponed-count", ED_INDEX, ED_IND_POSTPONED_COUNT, NULL },
65 { "P", "percentage", ED_MENU, ED_MEN_PERCENTAGE, NULL },
66 { "r", "readonly", ED_INDEX, ED_IND_READONLY, NULL },
67 { "R", "read-count", ED_INDEX, ED_IND_READ_COUNT, NULL },
68 { "s", "sort", ED_GLOBAL, ED_GLO_CONFIG_SORT, NULL },
69 { "S", "sort-aux", ED_GLOBAL, ED_GLO_CONFIG_SORT_AUX, NULL },
70 { "t", "tagged-count", ED_INDEX, ED_IND_TAGGED_COUNT, NULL },
71 { "T", "use-threads", ED_GLOBAL, ED_GLO_CONFIG_USE_THREADS, NULL },
72 { "u", "unread-count", ED_INDEX, ED_IND_UNREAD_COUNT, NULL },
73 { "v", "version", ED_GLOBAL, ED_GLO_VERSION, NULL },
74 { "V", "limit-pattern", ED_INDEX, ED_IND_LIMIT_PATTERN, NULL },
75 { NULL, NULL, 0, -1, NULL }
76 // clang-format on
77};
78
82static struct ConfigDef IndexVars[] = {
83 // clang-format off
84 { "change_folder_next", DT_BOOL, false, 0, NULL,
85 "Suggest the next folder, rather than the first when using '<change-folder>'"
86 },
87 { "collapse_all", DT_BOOL, false, 0, NULL,
88 "Collapse all threads when entering a folder"
89 },
90 { "mark_macro_prefix", DT_STRING, IP "'", 0, NULL,
91 "Prefix for macros using '<mark-message>'"
92 },
93 // L10N: $status_format default format
94 { "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,
95 "printf-like format string for the index's status line"
96 },
97 { "uncollapse_jump", DT_BOOL, false, 0, NULL,
98 "When opening a thread, jump to the next unread message"
99 },
100 { "uncollapse_new", DT_BOOL, true, 0, NULL,
101 "Open collapsed threads when new mail arrives"
102 },
103 { NULL },
104 // clang-format on
105};
106
111{
113}
Convenience wrapper for the config headers.
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition: set.c:281
#define IP
Definition: set.h:54
@ ED_MENU
Menu ED_MEN_ ExpandoDataMenu.
Definition: domain.h:48
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition: domain.h:44
@ ED_INDEX
Index ED_IND_ ExpandoDataIndex.
Definition: domain.h:46
Parse Expando string.
bool config_init_index(struct ConfigSet *cs)
Register index config variables - Implements module_init_config_t -.
Definition: config.c:110
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
const struct ExpandoDefinition StatusFormatDef[]
Expando definitions.
Definition: config.c:47
static struct ConfigDef IndexVars[]
Config definitions for the Index.
Definition: config.c:82
Data shared between Index, Pager and Sidebar.
@ ED_IND_LIMIT_COUNT
Mailbox.vcount.
Definition: shared_data.h:59
@ ED_IND_MAILBOX_PATH
Mailbox.pathbuf, Mailbox.name.
Definition: shared_data.h:62
@ ED_IND_DELETED_COUNT
Mailbox.msg_deleted.
Definition: shared_data.h:56
@ ED_IND_NEW_COUNT
Mailbox.msg_new.
Definition: shared_data.h:65
@ ED_IND_MAILBOX_SIZE
Mailbox.size.
Definition: shared_data.h:63
@ ED_IND_LIMIT_PATTERN
MailboxView.pattern.
Definition: shared_data.h:60
@ ED_IND_READ_COUNT
Mailbox.msg_count, Mailbox.msg_unread.
Definition: shared_data.h:69
@ ED_IND_POSTPONED_COUNT
mutt_num_postponed()
Definition: shared_data.h:67
@ ED_IND_FLAGGED_COUNT
Mailbox.msg_flagged.
Definition: shared_data.h:58
@ ED_IND_MESSAGE_COUNT
Mailbox.msg_count.
Definition: shared_data.h:64
@ ED_IND_OLD_COUNT
Mailbox.msg_unread, Mailbox.msg_new.
Definition: shared_data.h:66
@ ED_IND_READONLY
Mailbox.readonly, Mailbox.dontwrite.
Definition: shared_data.h:68
@ ED_IND_UNREAD_COUNT
Mailbox.msg_unread.
Definition: shared_data.h:71
@ ED_IND_TAGGED_COUNT
Mailbox.msg_tagged.
Definition: shared_data.h:70
@ ED_IND_LIMIT_SIZE
MailboxView.vsize.
Definition: shared_data.h:61
@ ED_IND_DESCRIPTION
Mailbox.name.
Definition: shared_data.h:57
@ ED_IND_UNREAD_MAILBOXES
Mailbox, mutt_mailbox_check()
Definition: shared_data.h:72
GUI present the user with a selectable list.
@ ED_MEN_PERCENTAGE
Menu.top, ...
Definition: lib.h:68
Convenience wrapper for the library headers.
#define N_(a)
Definition: message.h:32
Definition: set.h:64
Container for lots of config items.
Definition: set.h:252
Definition of a format string.
Definition: definition.h:44
#define D_L10N_STRING
String can be localised.
Definition: types.h:82
@ DT_BOOL
boolean option
Definition: types.h:32
@ DT_STRING
a string
Definition: types.h:45
@ DT_EXPANDO
an expando
Definition: types.h:34
@ ED_GLO_CONFIG_USE_THREADS
Value of $use_threads.
Definition: uid.h:36
@ ED_GLO_PADDING_EOL
Padding to end-of-line.
Definition: uid.h:38
@ ED_GLO_CONFIG_SORT
Value of $sort.
Definition: uid.h:34
@ ED_GLO_VERSION
NeoMutt version.
Definition: uid.h:42
@ ED_GLO_PADDING_HARD
Hard Padding.
Definition: uid.h:39
@ ED_GLO_PADDING_SOFT
Soft Padding.
Definition: uid.h:40
@ ED_GLO_CONFIG_SORT_AUX
Value of $sort_aux.
Definition: uid.h:35
@ ED_GLO_HOSTNAME
Local hostname.
Definition: uid.h:37