NeoMutt  2023-03-22
Teaching an old dog new tricks
DOXYGEN
config.c
Go to the documentation of this file.
1
29#include "config.h"
30#include <stddef.h>
31#include <config/lib.h>
32#include <mutt/lib.h>
33#include <stdbool.h>
34
38const struct Mapping SortSidebarMethods[] = {
39 // clang-format off
40 { "path", SORT_PATH },
41 { "alpha", SORT_PATH },
42 { "name", SORT_PATH },
43 { "count", SORT_COUNT },
44 { "desc", SORT_DESC },
45 { "flagged", SORT_FLAGGED },
46 { "unsorted", SORT_ORDER },
47 { "mailbox-order", SORT_ORDER },
48 { "unread", SORT_UNREAD },
49 { "new", SORT_UNREAD },
50 { NULL, 0 },
51 // clang-format on
52};
53
57static struct ConfigDef SidebarVars[] = {
58 // clang-format off
59 { "sidebar_component_depth", DT_NUMBER, 0, 0, NULL,
60 "(sidebar) Strip leading path components from sidebar folders"
61 },
62 { "sidebar_delim_chars", DT_STRING, IP "/.", 0, NULL,
63 "(sidebar) Characters that separate nested folders"
64 },
65 { "sidebar_divider_char", DT_STRING, IP "\342\224\202", 0, NULL, // Box Drawings Light Vertical, U+2502
66 "(sidebar) Character to draw between the sidebar and index"
67 },
68 { "sidebar_folder_indent", DT_BOOL, false, 0, NULL,
69 "(sidebar) Indent nested folders"
70 },
71 { "sidebar_format", DT_STRING|DT_NOT_EMPTY, IP "%D%* %n", 0, NULL,
72 "(sidebar) printf-like format string for the sidebar panel"
73 },
74 { "sidebar_indent_string", DT_STRING, IP " ", 0, NULL,
75 "(sidebar) Indent nested folders using this string"
76 },
77 { "sidebar_new_mail_only", DT_BOOL, false, 0, NULL,
78 "(sidebar) Only show folders with new/flagged mail"
79 },
80 { "sidebar_next_new_wrap", DT_BOOL, false, 0, NULL,
81 "(sidebar) Wrap around when searching for the next mailbox with new mail"
82 },
83 { "sidebar_non_empty_mailbox_only", DT_BOOL, false, 0, NULL,
84 "(sidebar) Only show folders with a non-zero number of mail"
85 },
86 { "sidebar_on_right", DT_BOOL, false, 0, NULL,
87 "(sidebar) Display the sidebar on the right"
88 },
89 { "sidebar_short_path", DT_BOOL, false, 0, NULL,
90 "(sidebar) Abbreviate the paths using the `$folder` variable"
91 },
92 { "sidebar_sort_method", DT_SORT, SORT_ORDER, IP SortSidebarMethods, NULL,
93 "(sidebar) Method to sort the sidebar"
94 },
95 { "sidebar_visible", DT_BOOL, false, 0, NULL,
96 "(sidebar) Show the sidebar"
97 },
98 { "sidebar_width", DT_NUMBER|DT_NOT_NEGATIVE, 30, 0, NULL,
99 "(sidebar) Width of the sidebar"
100 },
101 { NULL },
102 // clang-format on
103};
104
109{
111}
Convenience wrapper for the config headers.
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[], uint32_t flags)
Register a set of config items.
Definition: set.c:276
#define IP
Definition: set.h:54
bool config_init_sidebar(struct ConfigSet *cs)
Register sidebar config variables - Implements module_init_config_t -.
Definition: config.c:108
Convenience wrapper for the library headers.
static struct ConfigDef SidebarVars[]
Config definitions for the sidebar.
Definition: config.c:57
const struct Mapping SortSidebarMethods[]
Sort methods for the sidebar.
Definition: config.c:38
@ SORT_ORDER
Sort by the order the messages appear in the mailbox.
Definition: sort2.h:44
@ SORT_PATH
Sort by the folder's path.
Definition: sort2.h:57
@ SORT_FLAGGED
Sort by the number of flagged emails.
Definition: sort2.h:56
@ SORT_DESC
Sort by the folder's description.
Definition: sort2.h:59
@ SORT_COUNT
Sort by number of emails in a folder.
Definition: sort2.h:54
@ SORT_UNREAD
Sort by the number of unread emails.
Definition: sort2.h:55
Definition: set.h:64
Container for lots of config items.
Definition: set.h:252
Mapping between user-readable string and a constant.
Definition: mapping.h:32
#define DT_SORT
sorting methods
Definition: types.h:40
#define DT_BOOL
boolean option
Definition: types.h:30
#define DT_NOT_EMPTY
Empty strings are not allowed.
Definition: types.h:48
#define DT_STRING
a string
Definition: types.h:41
#define DT_NO_FLAGS
No flags are set.
Definition: types.h:46
#define DT_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:49
#define DT_NUMBER
a number
Definition: types.h:35