NeoMutt  2025-01-09-41-g086358
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
config.c
Go to the documentation of this file.
1
31#include "config.h"
32#include <stdbool.h>
33#include <stddef.h>
34#include "mutt/lib.h"
35#include "config/lib.h"
36#include "expando/lib.h"
37#include "shared_data.h"
38
39#ifndef ISPELL
40#define ISPELL "ispell"
41#endif
42
49static const struct ExpandoDefinition ComposeFormatDef[] = {
50 // clang-format off
51 { "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
52 { ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
53 { "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
54 { "a", "attach-count", ED_COMPOSE, ED_COM_ATTACH_COUNT, NULL },
55 { "h", "hostname", ED_GLOBAL, ED_GLO_HOSTNAME, NULL },
56 { "l", "attach-size", ED_COMPOSE, ED_COM_ATTACH_SIZE, NULL },
57 { "v", "version", ED_GLOBAL, ED_GLO_VERSION, NULL },
58 { NULL, NULL, 0, -1, NULL }
59 // clang-format on
60};
61
65static struct ConfigDef ComposeVars[] = {
66 // clang-format off
67 { "compose_confirm_detach_first", DT_BOOL, true, 0, NULL,
68 "Prevent the accidental deletion of the composed message"
69 },
70 // L10N: $compose_format default format
71 { "compose_format", DT_EXPANDO|D_L10N_STRING, IP N_("-- NeoMutt: Compose [Approx. msg size: %l Atts: %a]%>-"), IP &ComposeFormatDef, NULL,
72 "printf-like format string for the Compose panel's status bar"
73 },
74 { "compose_show_preview", DT_BOOL, false, 0, NULL,
75 "Display a preview of the message body in the Compose window"
76 },
77 { "compose_show_user_headers", DT_BOOL, true, 0, NULL,
78 "Controls whether or not custom headers are shown in the compose envelope"
79 },
80 { "compose_preview_min_rows", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 5, 0, NULL,
81 "Hide the preview if it has fewer than this number of rows"
82 },
83 { "compose_preview_above_attachments", DT_BOOL, false, 0, NULL,
84 "Show the message preview above the attachments list. By default it is shown below it."
85 },
86 { "copy", DT_QUAD, MUTT_YES, 0, NULL,
87 "Save outgoing emails to $record"
88 },
89 { "edit_headers", DT_BOOL, false, 0, NULL,
90 "Let the user edit the email headers whilst editing an email"
91 },
92 { "ispell", DT_STRING|D_STRING_COMMAND, IP ISPELL, 0, NULL,
93 "External command to perform spell-checking"
94 },
95 { "postpone", DT_QUAD, MUTT_ASKYES, 0, NULL,
96 "Save messages to the `$postponed` folder"
97 },
98 { NULL },
99 // clang-format on
100};
101
106{
108}
static struct ConfigDef ComposeVars[]
Config definitions for compose.
Definition: config.c:65
#define ISPELL
Definition: config.c:40
static const struct ExpandoDefinition ComposeFormatDef[]
Expando definitions.
Definition: config.c:49
@ ED_COM_ATTACH_COUNT
ComposeAttachData, num_attachments()
Definition: shared_data.h:58
@ ED_COM_ATTACH_SIZE
ComposeAttachData, cum_attachs_size()
Definition: shared_data.h:59
Convenience wrapper for the config headers.
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition: set.c:281
#define IP
Definition: set.h:54
@ ED_COMPOSE
Compose ED_COM_ ExpandoDataCompose.
Definition: domain.h:39
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition: domain.h:44
Parse Expando string.
bool config_init_compose(struct ConfigSet *cs)
Register compose config variables - Implements module_init_config_t -.
Definition: config.c:105
struct ExpandoNode * node_padding_parse(const char *str, struct ExpandoFormat *fmt, int did, int uid, ExpandoParserFlags flags, const char **parsed_until, struct ExpandoParseError *err)
Parse a Padding Expando - Implements ExpandoDefinition::parse() -.
Definition: node_padding.c:234
Data shared between Index, Pager and Sidebar.
Convenience wrapper for the library headers.
#define N_(a)
Definition: message.h:32
@ MUTT_ASKYES
Ask the user, defaulting to 'Yes'.
Definition: quad.h:41
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition: quad.h:39
Definition: set.h:64
Container for lots of config items.
Definition: set.h:252
Definition of a format string.
Definition: definition.h:44
#define D_STRING_COMMAND
A command.
Definition: types.h:99
#define D_L10N_STRING
String can be localised.
Definition: types.h:82
@ DT_NUMBER
a number
Definition: types.h:39
@ DT_BOOL
boolean option
Definition: types.h:32
@ DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition: types.h:41
@ DT_STRING
a string
Definition: types.h:45
@ DT_EXPANDO
an expando
Definition: types.h:34
#define D_INTEGER_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:101
@ ED_GLO_PADDING_EOL
Padding to end-of-line.
Definition: uid.h:38
@ ED_GLO_VERSION
NeoMutt version.
Definition: uid.h:42
@ ED_GLO_PADDING_HARD
Hard Padding.
Definition: uid.h:39
@ ED_GLO_PADDING_SOFT
Soft Padding.
Definition: uid.h:40
@ ED_GLO_HOSTNAME
Local hostname.
Definition: uid.h:37