NeoMutt  2021-02-05-666-ge300cd
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 
38 const 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  { "new", SORT_UNREAD },
49  { "unread", SORT_UNREAD },
50  { NULL, 0 },
51  // clang-format on
52 };
53 
54 static struct ConfigDef SidebarVars[] = {
55  // clang-format off
56  { "sidebar_component_depth", DT_NUMBER, 0, 0, NULL,
57  "(sidebar) Strip leading path components from sidebar folders"
58  },
59  { "sidebar_delim_chars", DT_STRING, IP "/.", 0, NULL,
60  "(sidebar) Characters that separate nested folders"
61  },
62  { "sidebar_divider_char", DT_STRING, 0, 0, NULL,
63  "(sidebar) Character to draw between the sidebar and index"
64  },
65  { "sidebar_folder_indent", DT_BOOL, false, 0, NULL,
66  "(sidebar) Indent nested folders"
67  },
68  { "sidebar_format", DT_STRING|DT_NOT_EMPTY, IP "%D%* %n", 0, NULL,
69  "(sidebar) printf-like format string for the sidebar panel"
70  },
71  { "sidebar_indent_string", DT_STRING, IP " ", 0, NULL,
72  "(sidebar) Indent nested folders using this string"
73  },
74  { "sidebar_new_mail_only", DT_BOOL, false, 0, NULL,
75  "(sidebar) Only show folders with new/flagged mail"
76  },
77  { "sidebar_next_new_wrap", DT_BOOL, false, 0, NULL,
78  "(sidebar) Wrap around when searching for the next mailbox with new mail"
79  },
80  { "sidebar_non_empty_mailbox_only", DT_BOOL, false, 0, NULL,
81  "(sidebar) Only show folders with a non-zero number of mail"
82  },
83  { "sidebar_on_right", DT_BOOL, false, 0, NULL,
84  "(sidebar) Display the sidebar on the right"
85  },
86  { "sidebar_short_path", DT_BOOL, false, 0, NULL,
87  "(sidebar) Abbreviate the paths using the `$folder` variable"
88  },
89  { "sidebar_sort_method", DT_SORT, SORT_ORDER, IP SortSidebarMethods, NULL,
90  "(sidebar) Method to sort the sidebar"
91  },
92  { "sidebar_visible", DT_BOOL, false, 0, NULL,
93  "(sidebar) Show the sidebar"
94  },
95  { "sidebar_width", DT_NUMBER|DT_NOT_NEGATIVE, 30, 0, NULL,
96  "(sidebar) Width of the sidebar"
97  },
98  { NULL },
99  // clang-format on
100 };
101 
106 {
107  return cs_register_variables(cs, SidebarVars, 0);
108 }
Container for lots of config items.
Definition: set.h:259
#define IP
Definition: set.h:54
#define DT_NOT_EMPTY
Empty strings are not allowed.
Definition: types.h:46
Sort by the number of flagged emails.
Definition: sort2.h:60
Sort by the folder&#39;s path.
Definition: sort2.h:61
#define DT_SORT
sorting methods
Definition: types.h:40
#define DT_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:47
Definition: set.h:63
Convenience wrapper for the config headers.
Sort by the order the messages appear in the mailbox.
Definition: sort2.h:48
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 DT_STRING
a string
Definition: types.h:41
bool config_init_sidebar(struct ConfigSet *cs)
Register sidebar config variables - Implements module_init_config_t -.
Definition: config.c:105
Sort by the number of unread emails.
Definition: sort2.h:59
Sort by the folder&#39;s description.
Definition: sort2.h:63
Mapping between user-readable string and a constant.
Definition: mapping.h:31
Sort by number of emails in a folder.
Definition: sort2.h:58
Convenience wrapper for the library headers.
#define DT_NUMBER
a number
Definition: types.h:35
#define DT_BOOL
boolean option
Definition: types.h:30