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 <stdbool.h>
33 #include "mutt/lib.h"
34 
38 const struct Mapping SortAliasMethods[] = {
39  // clang-format off
40  { "address", SORT_ADDRESS },
41  { "alias", SORT_ALIAS },
42  { "unsorted", SORT_ORDER },
43  { NULL, 0 },
44  // clang-format on
45 };
46 
47 static struct ConfigDef AliasVars[] = {
48  // clang-format off
49  { "alias_file", DT_PATH|DT_PATH_FILE, IP "~/.neomuttrc", 0, NULL,
50  "Save new aliases to this file"
51  },
52  { "alias_format", DT_STRING|DT_NOT_EMPTY, IP "%3n %f%t %-15a %-56r | %c", 0, NULL,
53  "printf-like format string for the alias menu"
54  },
55  { "sort_alias", DT_SORT|DT_SORT_REVERSE, SORT_ALIAS, IP SortAliasMethods, NULL,
56  "Sort method for the alias menu"
57  },
58  { "query_command", DT_STRING|DT_COMMAND, 0, 0, NULL,
59  "External command to query and external address book"
60  },
61  { "query_format", DT_STRING|DT_NOT_EMPTY, IP "%3c %t %-25.25n %-25.25a | %e", 0, NULL,
62  "printf-like format string for the query menu (address book)"
63  },
64  { NULL },
65  // clang-format on
66 };
67 
71 bool config_init_alias(struct ConfigSet *cs)
72 {
73  return cs_register_variables(cs, AliasVars, 0);
74 }
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
#define DT_SORT
sorting methods
Definition: types.h:40
Sort by email address.
Definition: sort2.h:54
#define DT_SORT_REVERSE
Sort flag for -reverse prefix.
Definition: sort2.h:36
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_PATH_FILE
Path is a file.
Definition: types.h:54
#define DT_STRING
a string
Definition: types.h:41
#define DT_PATH
a path to a file/directory
Definition: types.h:36
bool config_init_alias(struct ConfigSet *cs)
Register alias config variables - Implements module_init_config_t -.
Definition: config.c:71
#define DT_COMMAND
A command.
Definition: types.h:50
Sort by email alias.
Definition: sort2.h:53
Mapping between user-readable string and a constant.
Definition: mapping.h:31
Convenience wrapper for the library headers.
const struct Mapping SortAliasMethods[]
Sort methods for email aliases.
Definition: config.c:38