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 <config/lib.h>
31 #include <stdbool.h>
32 
36 const struct Mapping SortAliasMethods[] = {
37  // clang-format off
38  { "address", SORT_ADDRESS },
39  { "alias", SORT_ALIAS },
40  { "unsorted", SORT_ORDER },
41  { NULL, 0 },
42  // clang-format on
43 };
44 
45 struct ConfigDef AliasVars[] = {
46  // clang-format off
47  { "alias_file", DT_PATH|DT_PATH_FILE, NULL, IP "~/.neomuttrc", 0, NULL,
48  "Save new aliases to this file"
49  },
50  { "alias_format", DT_STRING|DT_NOT_EMPTY, NULL, IP "%3n %f%t %-15a %-56r | %c", 0, NULL,
51  "printf-like format string for the alias menu"
52  },
53  { "sort_alias", DT_SORT|DT_SORT_REVERSE, NULL, SORT_ALIAS, IP SortAliasMethods, NULL,
54  "Sort method for the alias menu"
55  },
56  { "query_command", DT_STRING|DT_COMMAND, NULL, 0, 0, NULL,
57  "External command to query and external address book"
58  },
59  { "query_format", DT_STRING|DT_NOT_EMPTY, NULL, IP "%3c %t %-25.25n %-25.25a | %e", 0, NULL,
60  "printf-like format string for the query menu (address book)"
61  },
62  { NULL, 0, NULL, 0, 0, NULL, NULL },
63  // clang-format on
64 };
65 
69 bool config_init_alias(struct ConfigSet *cs)
70 {
71  return cs_register_variables(cs, AliasVars, DT_NO_VARIABLE);
72 }
Container for lots of config items.
Definition: set.h:228
#define IP
Definition: set.h:54
#define DT_NO_VARIABLE
Config item doesn&#39;t have a backing global variable.
Definition: types.h:84
#define DT_NOT_EMPTY
Empty strings are not allowed.
Definition: types.h:46
#define DT_SORT
sorting methods
Definition: types.h:40
Sort by email address.
Definition: sort2.h:56
#define DT_SORT_REVERSE
Sort flag for -reverse prefix.
Definition: sort2.h:38
Config item definition.
Definition: set.h:61
Convenience wrapper for the config headers.
Sort by the order the messages appear in the mailbox.
Definition: sort2.h:50
#define DT_PATH_FILE
Path is a file.
Definition: types.h:54
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
#define DT_PATH
a path to a file/directory
Definition: types.h:36
#define DT_COMMAND
A command.
Definition: types.h:50
Sort by email alias.
Definition: sort2.h:55
Mapping between user-readable string and a constant.
Definition: mapping.h:31
bool config_init_alias(struct ConfigSet *cs)
Register alias config variables - Implements module_init_config_t.
Definition: config.c:69
const struct Mapping SortAliasMethods[]
Sort methods for email aliases.
Definition: config.c:36