NeoMutt  2023-05-17-16-g61469c
Teaching an old dog new tricks
DOXYGEN
config.c
Go to the documentation of this file.
1
30#include "config.h"
31#include <stddef.h>
32#include <config/lib.h>
33#include <stdbool.h>
34#include "mutt/lib.h"
35
39static const struct Mapping SortBrowserMethods[] = {
40 // clang-format off
41 { "alpha", SORT_SUBJECT },
42 { "count", SORT_COUNT },
43 { "date", SORT_DATE },
44 { "desc", SORT_DESC },
45 { "new", SORT_UNREAD },
46 { "unread", SORT_UNREAD },
47 { "size", SORT_SIZE },
48 { "unsorted", SORT_ORDER },
49 { NULL, 0 },
50 // clang-format on
51};
52
56static struct ConfigDef BrowserVars[] = {
57 // clang-format off
58 { "browser_abbreviate_mailboxes", DT_BOOL, true, 0, NULL,
59 "Abbreviate mailboxes using '~' and '=' in the browser"
60 },
61 { "folder_format", DT_STRING|DT_NOT_EMPTY, IP "%2C %t %N %F %2l %-8.8u %-8.8g %8s %d %i", 0, NULL,
62 "printf-like format string for the browser's display of folders"
63 },
64 { "group_index_format", DT_STRING|DT_NOT_EMPTY|R_INDEX, IP "%4C %M%N %5s %-45.45f %d", 0, NULL,
65 "(nntp) printf-like format string for the browser's display of newsgroups"
66 },
67 { "mailbox_folder_format", DT_STRING|DT_NOT_EMPTY, IP "%2C %?n?%6n&%6 ? %6m %i", 0, NULL,
68 "printf-like format string for the browser's display of mailbox folders"
69 },
70 { "mask", DT_REGEX|DT_REGEX_MATCH_CASE|DT_REGEX_ALLOW_NOT|DT_REGEX_NOSUB, IP "!^\\.[^.]", 0, NULL,
71 "Only display files/dirs matching this regex in the browser"
72 },
73 { "show_only_unread", DT_BOOL, false, 0, NULL,
74 "(nntp) Only show subscribed newsgroups with unread articles"
75 },
76 { "sort_browser", DT_SORT|DT_SORT_REVERSE, SORT_ALPHA, IP SortBrowserMethods, NULL,
77 "Sort method for the browser"
78 },
79 { NULL },
80 // clang-format on
81};
82
87{
89}
static struct ConfigDef BrowserVars[]
Config definitions for the browser.
Definition: config.c:56
static const struct Mapping SortBrowserMethods[]
Sort methods for the folder/dir browser.
Definition: config.c:39
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:279
#define IP
Definition: set.h:54
bool config_init_browser(struct ConfigSet *cs)
Register browser config variables - Implements module_init_config_t -.
Definition: config.c:86
Convenience wrapper for the library headers.
#define DT_REGEX_ALLOW_NOT
Regex can begin with '!'.
Definition: regex3.h:36
#define DT_REGEX_MATCH_CASE
Case-sensitive matching.
Definition: regex3.h:35
#define DT_REGEX_NOSUB
Do not report what was matched (REG_NOSUB)
Definition: regex3.h:37
#define DT_SORT_REVERSE
Sort flag for -reverse prefix.
Definition: sort2.h:32
@ SORT_SUBJECT
Sort by the email's subject.
Definition: sort2.h:42
@ SORT_ORDER
Sort by the order the messages appear in the mailbox.
Definition: sort2.h:44
@ SORT_SIZE
Sort by the size of the email.
Definition: sort2.h:40
@ SORT_DESC
Sort by the folder's description.
Definition: sort2.h:59
@ SORT_ALPHA
Required by makedoc.c.
Definition: sort2.h:41
@ SORT_DATE
Sort by the date the email was sent.
Definition: sort2.h:39
@ 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:49
#define DT_STRING
a string
Definition: types.h:41
#define R_INDEX
Redraw the index menu (MENU_INDEX)
Definition: types.h:68
#define DT_NO_FLAGS
No flags are set.
Definition: types.h:47
#define DT_REGEX
regular expressions
Definition: types.h:38