NeoMutt  2023-05-17-56-ga67199
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
38static struct ConfigDef PagerVars[] = {
39 // clang-format off
40 { "allow_ansi", DT_BOOL, false, 0, NULL,
41 "Allow ANSI colour codes in rich text messages"
42 },
43 { "display_filter", DT_STRING|DT_COMMAND, 0, 0, NULL,
44 "External command to pre-process an email before display"
45 },
46 { "header_color_partial", DT_BOOL, false, 0, NULL,
47 "Only colour the part of the header matching the regex"
48 },
49 { "pager", DT_STRING|DT_COMMAND, IP "builtin", 0, NULL,
50 "External command for viewing messages, or 'builtin' to use NeoMutt's"
51 },
52 { "pager_context", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
53 "Number of lines of overlap when changing pages in the pager"
54 },
55 { "pager_format", DT_STRING, IP "-%Z- %C/%m: %-20.20n %s%* -- (%P)", 0, NULL,
56 "printf-like format string for the pager's status bar"
57 },
58 { "pager_index_lines", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
59 "Number of index lines to display above the pager"
60 },
61 { "pager_read_delay", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
62 "Number of seconds to wait before marking a message read"
63 },
64 { "pager_skip_quoted_context", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
65 "Lines of context to show when skipping quoted text"
66 },
67 { "pager_stop", DT_BOOL, false, 0, NULL,
68 "Don't automatically open the next message when at the end of a message"
69 },
70 { "prompt_after", DT_BOOL, true, 0, NULL,
71 "Pause after running an external pager"
72 },
73 { "search_context", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
74 "Context to display around search matches"
75 },
76 { "smart_wrap", DT_BOOL, true, 0, NULL,
77 "Wrap text at word boundaries"
78 },
79 { "smileys", DT_REGEX, IP "(>From )|(:[-^]?[][)(><}{|/DP])", 0, NULL,
80 "Regex to match smileys to prevent mistakes when quoting text"
81 },
82 { "tilde", DT_BOOL, false, 0, NULL,
83 "Display '~' in the pager after the end of the email"
84 },
85 { "toggle_quoted_show_levels", DT_NUMBER|DT_NOT_NEGATIVE, 0, 0, NULL,
86 "Number of quote levels to show with toggle-quoted"
87 },
88
89 { "skip_quoted_offset", DT_SYNONYM, IP "pager_skip_quoted_context", IP "2021-06-18" },
90
91 { NULL },
92 // clang-format on
93};
94
103const char *pager_get_pager(struct ConfigSubset *sub)
104{
105 const char *c_pager = cs_subset_string(sub, "pager");
106 if (!c_pager || mutt_str_equal(c_pager, "builtin"))
107 return NULL;
108
109 return c_pager;
110}
111
116{
118}
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
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:279
#define IP
Definition: set.h:54
bool config_init_pager(struct ConfigSet *cs)
Register pager config variables - Implements module_init_config_t -.
Definition: config.c:115
Convenience wrapper for the library headers.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:798
const char * pager_get_pager(struct ConfigSubset *sub)
Get the value of $pager.
Definition: config.c:103
static struct ConfigDef PagerVars[]
Config definitions for the Pager.
Definition: config.c:38
Definition: set.h:64
Container for lots of config items.
Definition: set.h:252
A set of inherited config items.
Definition: subset.h:47
#define DT_BOOL
boolean option
Definition: types.h:30
#define DT_STRING
a string
Definition: types.h:41
#define DT_COMMAND
A command.
Definition: types.h:53
#define DT_SYNONYM
synonym for another variable
Definition: types.h:42
#define DT_NO_FLAGS
No flags are set.
Definition: types.h:47
#define DT_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:50
#define DT_REGEX
regular expressions
Definition: types.h:38
#define DT_NUMBER
a number
Definition: types.h:35