NeoMutt  2020-11-20
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 <stdbool.h>
33 #include "private.h"
34 #include "lib.h"
35 
36 // clang-format off
52 // clang-format on
53 
54 struct ConfigDef NotmuchVars[] = {
55  // clang-format off
56  { "nm_db_limit", DT_NUMBER|DT_NOT_NEGATIVE, &C_NmDbLimit, 0, 0, NULL,
57  "(notmuch) Default limit for Notmuch queries"
58  },
59  { "nm_default_url", DT_STRING, &C_NmDefaultUrl, 0, 0, NULL,
60  "(notmuch) Path to the Notmuch database"
61  },
62  { "nm_exclude_tags", DT_STRING, &C_NmExcludeTags, 0, 0, NULL,
63  "(notmuch) Exclude messages with these tags"
64  },
65  { "nm_flagged_tag", DT_STRING, &C_NmFlaggedTag, IP "flagged", 0, NULL,
66  "(notmuch) Tag to use for flagged messages"
67  },
68  { "nm_open_timeout", DT_NUMBER|DT_NOT_NEGATIVE, &C_NmOpenTimeout, 5, 0, NULL,
69  "(notmuch) Database timeout"
70  },
71  { "nm_query_type", DT_STRING, &C_NmQueryType, IP "messages", 0, NULL,
72  "(notmuch) Default query type: 'threads' or 'messages'"
73  },
74  { "nm_query_window_current_position", DT_NUMBER, &C_NmQueryWindowCurrentPosition, 0, 0, NULL,
75  "(notmuch) Position of current search window"
76  },
77  { "nm_query_window_current_search", DT_STRING, &C_NmQueryWindowCurrentSearch, 0, 0, NULL,
78  "(notmuch) Current search parameters"
79  },
80  { "nm_query_window_duration", DT_NUMBER|DT_NOT_NEGATIVE, &C_NmQueryWindowDuration, 0, 0, NULL,
81  "(notmuch) Time duration of the current search window"
82  },
83  { "nm_query_window_timebase", DT_STRING, &C_NmQueryWindowTimebase, IP "week", 0, NULL,
84  "(notmuch) Units for the time duration"
85  },
86  { "nm_record_tags", DT_STRING, &C_NmRecordTags, 0, 0, NULL,
87  "(notmuch) Tags to apply to the 'record' mailbox (sent mail)"
88  },
89  { "nm_replied_tag", DT_STRING, &C_NmRepliedTag, IP "replied", 0, NULL,
90  "(notmuch) Tag to use for replied messages"
91  },
92  { "nm_unread_tag", DT_STRING, &C_NmUnreadTag, IP "unread", 0, NULL,
93  "(notmuch) Tag to use for unread messages"
94  },
95  { "vfolder_format", DT_STRING|DT_NOT_EMPTY|R_INDEX, &C_VfolderFormat, IP "%2C %?n?%4n/& ?%4m %f", 0, NULL,
96  "(notmuch) printf-like format string for the browser's display of virtual folders"
97  },
98  { "virtual_spoolfile", DT_BOOL, &C_VirtualSpoolfile, false, 0, NULL,
99  "(notmuch) Use the first virtual mailbox as a spool file"
100  },
101 
102  { "nm_default_uri", DT_SYNONYM, NULL, IP "nm_default_url" },
103  { NULL, 0, NULL, 0, 0, NULL, NULL },
104  // clang-format on
105 };
106 
111 {
112  return cs_register_variables(cs, NotmuchVars, 0);
113 }
Container for lots of config items.
Definition: set.h:228
#define IP
Definition: set.h:54
int C_NmOpenTimeout
Config: (notmuch) Database timeout.
Definition: config.c:41
char * C_NmQueryWindowTimebase
Config: (notmuch) Units for the time duration.
Definition: config.c:46
#define DT_NOT_EMPTY
Empty strings are not allowed.
Definition: types.h:46
#define DT_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:47
Config item definition.
Definition: set.h:61
int C_NmQueryWindowDuration
Config: (notmuch) Time duration of the current search window.
Definition: config.c:45
Convenience wrapper for the config headers.
char * C_NmFlaggedTag
Config: (notmuch) Tag to use for flagged messages.
Definition: config.c:40
char * C_NmUnreadTag
Config: (notmuch) Tag to use for unread messages.
Definition: config.c:49
char * C_NmDefaultUrl
Config: (notmuch) Path to the Notmuch database.
Definition: config.c:38
char * C_VfolderFormat
Config: (notmuch) printf-like format string for the browser&#39;s display of virtual folders.
Definition: config.c:50
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[], int flags)
Register a set of config items.
Definition: set.c:286
#define DT_STRING
a string
Definition: types.h:41
int C_NmQueryWindowCurrentPosition
Config: (notmuch) Position of current search window.
Definition: config.c:43
char * C_NmRepliedTag
Config: (notmuch) Tag to use for replied messages.
Definition: config.c:48
bool config_init_notmuch(struct ConfigSet *cs)
Register notmuch config variables - Implements module_init_config_t.
Definition: config.c:110
int C_NmDbLimit
Config: (notmuch) Default limit for Notmuch queries.
Definition: config.c:37
char * C_NmQueryWindowCurrentSearch
Config: (notmuch) Current search parameters.
Definition: config.c:44
#define DT_SYNONYM
synonym for another variable
Definition: types.h:42
char * C_NmExcludeTags
Config: (notmuch) Exclude messages with these tags.
Definition: config.c:39
char * C_NmQueryType
Config: (notmuch) Default query type: &#39;threads&#39; or &#39;messages&#39;.
Definition: config.c:42
Notmuch private types.
char * C_NmRecordTags
Config: (notmuch) Tags to apply to the &#39;record&#39; mailbox (sent mail)
Definition: config.c:47
#define DT_NUMBER
a number
Definition: types.h:35
#define DT_BOOL
boolean option
Definition: types.h:30
bool C_VirtualSpoolfile
Config: (notmuch) Use the first virtual mailbox as a spool file.
Definition: config.c:51
#define R_INDEX
Redraw the index menu (MENU_MAIN)
Definition: types.h:65