NeoMutt  2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
config.c File Reference

Config used by libcompose. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "expando/lib.h"
#include "shared_data.h"
Include dependency graph for config.c:

Go to the source code of this file.

Variables

static const struct ExpandoDefinition ComposeFormatDef []
 Expando definitions.
static const struct ExpandoDefinition SpellingCommandFormatDef []
 Expando definitions.
struct ConfigDef ComposeVars []
 Config definitions for compose.

Detailed Description

Config used by libcompose.

Authors
  • Matthew Hughes
  • Richard Russon
  • Dennis Schön

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file config.c.

Variable Documentation

◆ ComposeFormatDef

const struct ExpandoDefinition ComposeFormatDef[]
static
Initial value:
= {
{ "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
{ ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
{ "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
{ "a", "attach-count", ED_COMPOSE, ED_COM_ATTACH_COUNT, NULL },
{ "h", "hostname", ED_GLOBAL, ED_GLO_HOSTNAME, NULL },
{ "l", "attach-size", ED_COMPOSE, ED_COM_ATTACH_SIZE, NULL },
{ "v", "version", ED_GLOBAL, ED_GLO_VERSION, NULL },
{ NULL, NULL, 0, -1, NULL }
}
@ ED_COM_ATTACH_COUNT
ComposeAttachData, num_attachments().
Definition shared_data.h:57
@ ED_COM_ATTACH_SIZE
ComposeAttachData, cum_attachs_size().
Definition shared_data.h:58
@ ED_COMPOSE
Compose ED_COM_ ExpandoDataCompose.
Definition domain.h:39
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition domain.h:44
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() -.
@ 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

Expando definitions.

Config:

  • $compose_format

Definition at line 45 of file config.c.

45 {
46 // clang-format off
47 { "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
48 { ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
49 { "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
50 { "a", "attach-count", ED_COMPOSE, ED_COM_ATTACH_COUNT, NULL },
51 { "h", "hostname", ED_GLOBAL, ED_GLO_HOSTNAME, NULL },
52 { "l", "attach-size", ED_COMPOSE, ED_COM_ATTACH_SIZE, NULL },
53 { "v", "version", ED_GLOBAL, ED_GLO_VERSION, NULL },
54 { NULL, NULL, 0, -1, NULL }
55 // clang-format on
56};

◆ SpellingCommandFormatDef

const struct ExpandoDefinition SpellingCommandFormatDef[]
static
Initial value:
= {
{ "f", "file", ED_COMPOSE, ED_COM_SPELLING_FILE, NULL },
{ NULL, NULL, 0, -1, NULL }
}
@ ED_COM_SPELLING_FILE
Spelling command's filename.
Definition shared_data.h:59

Expando definitions.

Config:

  • $spelling_command

Definition at line 64 of file config.c.

64 {
65 // clang-format off
66 { "f", "file", ED_COMPOSE, ED_COM_SPELLING_FILE, NULL },
67 { NULL, NULL, 0, -1, NULL }
68 // clang-format on
69};

◆ ComposeVars

struct ConfigDef ComposeVars[]

Config definitions for compose.

Definition at line 74 of file config.c.

74 {
75 // clang-format off
76 { "compose_confirm_detach_first", DT_BOOL, true, 0, NULL,
77 "Prevent the accidental deletion of the composed message"
78 },
79 // L10N: $compose_format default format
80 { "compose_format", DT_EXPANDO|D_L10N_STRING, IP N_("-- NeoMutt: Compose [Approx. msg size: %l Atts: %a]%>-"), IP &ComposeFormatDef, NULL,
81 "printf-like format string for the Compose panel's status bar"
82 },
83 { "compose_show_preview", DT_BOOL, true, 0, NULL,
84 "Display a preview of the message body in the Compose window"
85 },
86 { "compose_show_user_headers", DT_BOOL, true, 0, NULL,
87 "Controls whether or not custom headers are shown in the compose envelope"
88 },
89 { "compose_preview_min_rows", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 5, 0, NULL,
90 "Hide the preview if it has fewer than this number of rows"
91 },
92 { "compose_preview_above_attachments", DT_BOOL, false, 0, NULL,
93 "Show the message preview above the attachments list. By default it is shown below it."
94 },
95 { "copy", DT_QUAD, MUTT_YES, 0, NULL,
96 "Save outgoing emails to $record"
97 },
98 { "edit_headers", DT_BOOL, false, 0, NULL,
99 "Let the user edit the email headers whilst editing an email"
100 },
101 { "spelling_command", DT_EXPANDO|D_STRING_COMMAND, IP "ispell -x %f", IP &SpellingCommandFormatDef, NULL,
102 "External command to perform spell-checking"
103 },
104 { "postpone", DT_QUAD, MUTT_ASKYES, 0, NULL,
105 "Save messages to the `$postponed` folder"
106 },
107
108 { "edit_hdrs", DT_SYNONYM, IP "edit_headers", IP "2021-03-21" },
109 { "ispell", DT_SYNONYM, IP "spelling_command", IP "2026-07-14" },
110 { NULL },
111 // clang-format on
112};
static const struct ExpandoDefinition ComposeFormatDef[]
Expando definitions.
Definition config.c:45
static const struct ExpandoDefinition SpellingCommandFormatDef[]
Expando definitions.
Definition config.c:64
#define IP
Definition set.h:55
#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
#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:38
@ DT_BOOL
boolean option
Definition types.h:32
@ DT_QUAD
quad-option (no/yes/ask-no/ask-yes)
Definition types.h:40
@ DT_SYNONYM
synonym for another variable
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