NeoMutt  2025-09-05-43-g177ed6
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
config.c File Reference

Config used by libhistory. More...

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

Go to the source code of this file.

Functions

bool config_init_history (struct ConfigSet *cs)
 Register history config variables - Implements module_init_config_t -.
 

Variables

static const struct ExpandoDefinition HistoryFormatDef []
 Expando definitions.
 
static struct ConfigDef HistoryVars []
 Config definitions for the command history.
 

Detailed Description

Config used by libhistory.

Authors
  • Richard Russon

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

◆ HistoryFormatDef

const struct ExpandoDefinition HistoryFormatDef[]
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 },
{ "C", "number", ED_HISTORY, ED_HIS_NUMBER, NULL },
{ "s", "match", ED_HISTORY, ED_HIS_MATCH, NULL },
{ NULL, NULL, 0, -1, NULL }
}
@ ED_GLOBAL
Global ED_GLO_ ExpandoDataGlobal.
Definition domain.h:44
@ ED_HISTORY
History ED_HIS_ ExpandoDataHistory.
Definition domain.h:45
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_HIS_MATCH
HistoryEntry.history.
Definition lib.h:80
@ ED_HIS_NUMBER
HistoryEntry.num.
Definition lib.h:81
@ ED_GLO_PADDING_EOL
Padding to end-of-line.
Definition uid.h:38
@ ED_GLO_PADDING_HARD
Hard Padding.
Definition uid.h:39
@ ED_GLO_PADDING_SOFT
Soft Padding.
Definition uid.h:40

Expando definitions.

Config:

  • $history_format

Definition at line 42 of file config.c.

42 {
43 // clang-format off
44 { "*", "padding-soft", ED_GLOBAL, ED_GLO_PADDING_SOFT, node_padding_parse },
45 { ">", "padding-hard", ED_GLOBAL, ED_GLO_PADDING_HARD, node_padding_parse },
46 { "|", "padding-eol", ED_GLOBAL, ED_GLO_PADDING_EOL, node_padding_parse },
47 { "C", "number", ED_HISTORY, ED_HIS_NUMBER, NULL },
48 { "s", "match", ED_HISTORY, ED_HIS_MATCH, NULL },
49 { NULL, NULL, 0, -1, NULL }
50 // clang-format on
51};

◆ HistoryVars

struct ConfigDef HistoryVars[]
static
Initial value:
= {
{ "history", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 10, 0, NULL,
"Number of history entries to keep in memory per category"
},
{ "history_file", DT_PATH|D_PATH_FILE, IP "~/.mutthistory", 0, NULL,
"File to save history in"
},
{ "history_format", DT_EXPANDO, IP "%s", IP &HistoryFormatDef, NULL,
"printf-like format string for the history menu"
},
{ "history_remove_dups", DT_BOOL, false, 0, NULL,
"Remove duplicate entries from the history"
},
{ "save_history", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 0, 0, NULL,
"Number of history entries to save per category"
},
{ NULL },
}
#define IP
Definition set.h:52
static const struct ExpandoDefinition HistoryFormatDef[]
Expando definitions.
Definition config.c:42
#define D_PATH_FILE
Path is a file.
Definition types.h:103
@ DT_NUMBER
a number
Definition types.h:38
@ DT_BOOL
boolean option
Definition types.h:32
@ DT_EXPANDO
an expando
Definition types.h:34
@ DT_PATH
a path to a file/directory
Definition types.h:39
#define D_INTEGER_NOT_NEGATIVE
Negative numbers are not allowed.
Definition types.h:100

Config definitions for the command history.

Definition at line 56 of file config.c.

56 {
57 // clang-format off
58 { "history", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 10, 0, NULL,
59 "Number of history entries to keep in memory per category"
60 },
61 { "history_file", DT_PATH|D_PATH_FILE, IP "~/.mutthistory", 0, NULL,
62 "File to save history in"
63 },
64 { "history_format", DT_EXPANDO, IP "%s", IP &HistoryFormatDef, NULL,
65 "printf-like format string for the history menu"
66 },
67 { "history_remove_dups", DT_BOOL, false, 0, NULL,
68 "Remove duplicate entries from the history"
69 },
70 { "save_history", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 0, 0, NULL,
71 "Number of history entries to save per category"
72 },
73 { NULL },
74 // clang-format on
75};