57 intptr_t value,
struct Buffer *err)
60 const char *url = (
const char *) value;
63 buf_printf(err,
_(
"nm_default_url must be: notmuch://<absolute path> . Current: %s"), url);
84 intptr_t value,
struct Buffer *err)
87 const char *timebase = (
const char *) value;
93 err,
_(
"Invalid nm_query_window_timebase value (valid values are: "
94 "hour, day, week, month, year)"));
107 "(notmuch) Configuration file for notmuch. Use 'auto' to detect configuration."
109 {
"nm_config_profile",
DT_STRING, 0, 0, NULL,
110 "(notmuch) Configuration profile for notmuch."
113 "(notmuch) Default limit for Notmuch queries"
116 "(notmuch) Path to the Notmuch database"
118 {
"nm_exclude_tags",
DT_STRING, 0, 0, NULL,
119 "(notmuch) Exclude messages with these tags"
121 {
"nm_flagged_tag",
DT_STRING,
IP "flagged", 0, NULL,
122 "(notmuch) Tag to use for flagged messages"
125 "(notmuch) Database timeout"
127 {
"nm_query_type",
DT_STRING,
IP "messages", 0, NULL,
128 "(notmuch) Default query type: 'threads' or 'messages'"
130 {
"nm_query_window_current_position",
DT_NUMBER, 0, 0, NULL,
131 "(notmuch) Position of current search window"
133 {
"nm_query_window_current_search",
DT_STRING, 0, 0, NULL,
134 "(notmuch) Current search parameters"
137 "(notmuch) Time duration of the current search window"
139 {
"nm_query_window_enable",
DT_BOOL,
false, 0, NULL,
140 "(notmuch) Enable query windows"
142 {
"nm_query_window_or_terms",
DT_STRING, 0, 0, NULL,
143 "(notmuch) Additional notmuch search terms for messages to be shown regardless of date"
146 "(notmuch) Units for the time duration"
148 {
"nm_record_tags",
DT_STRING, 0, 0, NULL,
149 "(notmuch) Tags to apply to the 'record' mailbox (sent mail)"
151 {
"nm_replied_tag",
DT_STRING,
IP "replied", 0, NULL,
152 "(notmuch) Tag to use for replied messages"
154 {
"nm_unread_tag",
DT_STRING,
IP "unread", 0, NULL,
155 "(notmuch) Tag to use for unread messages"
157 {
"virtual_spool_file",
DT_BOOL,
false, 0, NULL,
158 "(notmuch) Use the first virtual mailbox as a spool file"
163 {
"nm_default_uri",
DT_SYNONYM,
IP "nm_default_url",
IP "2021-02-11" },
164 {
"virtual_spoolfile",
DT_SYNONYM,
IP "virtual_spool_file",
IP "2021-02-11" },
176#if defined(USE_NOTMUCH)
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
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.
#define CSR_ERR_INVALID
Value hasn't been set.
#define CSR_SUCCESS
Action completed successfully.
static int nm_query_window_timebase_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "nm_query_window_timebase" config variable - Implements ConfigDef::validator() -.
static int nm_default_url_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "nm_default_url" config variable - Implements ConfigDef::validator() -.
bool config_init_notmuch(struct ConfigSet *cs)
Register notmuch config variables - Implements module_init_config_t -.
Convenience wrapper for the library headers.
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
static bool is_valid_notmuch_url(const char *url)
Checks that a URL is in required form.
static struct ConfigDef NotmuchVars[]
Config definitions for the Notmuch library.
const int NmUrlProtocolLen
Length of NmUrlProtocol string.
const char NmUrlProtocol[]
Protocol string for Notmuch URLs.
bool nm_query_window_check_timebase(const char *timebase)
Checks if a given timebase string is valid.
String manipulation buffer.
Container for lots of config items.
#define DT_BOOL
boolean option
#define DT_DEPRECATED
Config item shouldn't be used any more.
#define DT_PATH_FILE
Path is a file.
#define DT_PATH
a path to a file/directory
#define DT_STRING
a string
#define DT_SYNONYM
synonym for another variable
#define DT_NO_FLAGS
No flags are set.
#define DT_NOT_NEGATIVE
Negative numbers are not allowed.
#define DT_NUMBER
a number