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 
34 static struct ConfigDef PagerVars[] = {
35  // clang-format off
36  { "allow_ansi", DT_BOOL, false, 0, NULL,
37  "Allow ANSI colour codes in rich text messages"
38  },
39  { "header_color_partial", DT_BOOL|R_PAGER_FLOW, false, 0, NULL,
40  "Only colour the part of the header matching the regex"
41  },
42  { "pager_context", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
43  "Number of lines of overlap when changing pages in the pager"
44  },
45  { "pager_index_lines", DT_NUMBER|DT_NOT_NEGATIVE|R_PAGER, 0, 0, NULL,
46  "Number of index lines to display above the pager"
47  },
48  { "pager_read_delay", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
49  "Number of seconds to wait before marking a message read"
50  },
51  { "pager_skip_quoted_context", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
52  "Lines of context to show when skipping quoted text"
53  },
54  { "pager_stop", DT_BOOL, false, 0, NULL,
55  "Don't automatically open the next message when at the end of a message"
56  },
57  { "search_context", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
58  "Context to display around search matches"
59  },
60  { "smart_wrap", DT_BOOL|R_PAGER_FLOW, true, 0, NULL,
61  "Wrap text at word boundaries"
62  },
63  { "smileys", DT_REGEX|R_PAGER, IP "(>From )|(:[-^]?[][)(><}{|/DP])", 0, NULL,
64  "Regex to match smileys to prevent mistakes when quoting text"
65  },
66  { "tilde", DT_BOOL|R_PAGER, false, 0, NULL,
67  "Character to pad blank lines in the pager"
68  },
69 
70  { "skip_quoted_offset", DT_SYNONYM, IP "pager_skip_quoted_context", },
71 
72  { NULL },
73  // clang-format on
74 };
75 
79 bool config_init_pager(struct ConfigSet *cs)
80 {
81  return cs_register_variables(cs, PagerVars, 0);
82 }
#define R_PAGER
Redraw the pager menu.
Definition: types.h:66
Container for lots of config items.
Definition: set.h:259
#define IP
Definition: set.h:54
#define R_PAGER_FLOW
Reflow line_info and redraw the pager menu.
Definition: types.h:67
#define DT_REGEX
regular expressions
Definition: types.h:38
#define DT_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:47
Definition: set.h:63
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.
Definition: set.c:276
#define DT_SYNONYM
synonym for another variable
Definition: types.h:42
bool config_init_pager(struct ConfigSet *cs)
Register pager config variables - Implements module_init_config_t -.
Definition: config.c:79
#define DT_NUMBER
a number
Definition: types.h:35
#define DT_BOOL
boolean option
Definition: types.h:30