NeoMutt  2025-12-11-58-g09398d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
commands.c
Go to the documentation of this file.
1
24
30
31#include "config.h"
32#include <stdbool.h>
33#include <stddef.h>
34#include "mutt/lib.h"
35#include "config/lib.h"
36#include "core/lib.h"
37#include "gui/lib.h"
38#include "mutt.h"
39#include "commands.h"
40#include "parse/lib.h"
41#include "attr.h"
42#include "color.h"
43#include "debug.h"
44#include "dump.h"
45#include "globals.h"
46#include "notify2.h"
47#include "parse_color.h"
48#include "regex4.h"
49#include "simple2.h"
50
54const struct Mapping ColorFields[] = {
55 // clang-format off
56 { "attachment", MT_COLOR_ATTACHMENT },
57 { "attach_headers", MT_COLOR_ATTACH_HEADERS },
58 { "body", MT_COLOR_BODY },
59 { "bold", MT_COLOR_BOLD },
60 { "compose_header", MT_COLOR_COMPOSE_HEADER },
61 { "compose_security_both", MT_COLOR_COMPOSE_SECURITY_BOTH },
62 { "compose_security_encrypt", MT_COLOR_COMPOSE_SECURITY_ENCRYPT },
63 { "compose_security_none", MT_COLOR_COMPOSE_SECURITY_NONE },
64 { "compose_security_sign", MT_COLOR_COMPOSE_SECURITY_SIGN },
65 { "error", MT_COLOR_ERROR },
66 { "hdrdefault", MT_COLOR_HDRDEFAULT },
67 { "header", MT_COLOR_HEADER },
68 { "index", MT_COLOR_INDEX },
69 { "index_author", MT_COLOR_INDEX_AUTHOR },
70 { "index_collapsed", MT_COLOR_INDEX_COLLAPSED },
71 { "index_date", MT_COLOR_INDEX_DATE },
72 { "index_flags", MT_COLOR_INDEX_FLAGS },
73 { "index_label", MT_COLOR_INDEX_LABEL },
74 { "index_number", MT_COLOR_INDEX_NUMBER },
75 { "index_size", MT_COLOR_INDEX_SIZE },
76 { "index_subject", MT_COLOR_INDEX_SUBJECT },
77 { "index_tag", MT_COLOR_INDEX_TAG },
78 { "index_tags", MT_COLOR_INDEX_TAGS },
79 { "indicator", MT_COLOR_INDICATOR },
80 { "italic", MT_COLOR_ITALIC },
81 { "markers", MT_COLOR_MARKERS },
82 { "message", MT_COLOR_MESSAGE },
83 { "normal", MT_COLOR_NORMAL },
84 { "options", MT_COLOR_OPTIONS },
85 { "progress", MT_COLOR_PROGRESS },
86 { "prompt", MT_COLOR_PROMPT },
87 { "quoted0", MT_COLOR_QUOTED0 },
88 { "quoted1", MT_COLOR_QUOTED1 },
89 { "quoted2", MT_COLOR_QUOTED2 },
90 { "quoted3", MT_COLOR_QUOTED3 },
91 { "quoted4", MT_COLOR_QUOTED4 },
92 { "quoted5", MT_COLOR_QUOTED5 },
93 { "quoted6", MT_COLOR_QUOTED6 },
94 { "quoted7", MT_COLOR_QUOTED7 },
95 { "quoted8", MT_COLOR_QUOTED8 },
96 { "quoted9", MT_COLOR_QUOTED9 },
97 { "search", MT_COLOR_SEARCH },
98 { "sidebar_background", MT_COLOR_SIDEBAR_BACKGROUND },
99 { "sidebar_divider", MT_COLOR_SIDEBAR_DIVIDER },
100 { "sidebar_flagged", MT_COLOR_SIDEBAR_FLAGGED },
101 { "sidebar_highlight", MT_COLOR_SIDEBAR_HIGHLIGHT },
102 { "sidebar_indicator", MT_COLOR_SIDEBAR_INDICATOR },
103 { "sidebar_new", MT_COLOR_SIDEBAR_NEW },
104 { "sidebar_ordinary", MT_COLOR_SIDEBAR_ORDINARY },
105 { "sidebar_spool_file", MT_COLOR_SIDEBAR_SPOOLFILE },
106 { "sidebar_unread", MT_COLOR_SIDEBAR_UNREAD },
107 { "signature", MT_COLOR_SIGNATURE },
108 { "status", MT_COLOR_STATUS },
109 { "stripe_even", MT_COLOR_STRIPE_EVEN},
110 { "stripe_odd", MT_COLOR_STRIPE_ODD},
111 { "tilde", MT_COLOR_TILDE },
112 { "tree", MT_COLOR_TREE },
113 { "underline", MT_COLOR_UNDERLINE },
114 { "warning", MT_COLOR_WARNING },
115 // Deprecated
116 { "quoted", MT_COLOR_QUOTED0 },
117 { "sidebar_spoolfile", MT_COLOR_SIDEBAR_SPOOLFILE },
118 { NULL, 0 },
119 // clang-format on
120};
121
127void get_colorid_name(unsigned int cid, struct Buffer *buf)
128{
129 const char *name = mutt_map_get_name(cid, ColorFields);
130 if (name)
131 buf_addstr(buf, name);
132 else
133 buf_printf(buf, "UNKNOWN %d", cid);
134}
135
146static enum CommandResult parse_object(const struct Command *cmd, struct Buffer *line,
147 enum ColorId *cid, struct Buffer *err)
148{
149 if (!MoreArgsF(line, TOKEN_COMMENT))
150 {
151 buf_printf(err, _("%s: too few arguments"), cmd->name);
152 return MUTT_CMD_WARNING;
153 }
154
155 struct Buffer *token = buf_pool_get();
156
158 color_debug(LL_DEBUG5, "color: %s\n", buf_string(token));
159
160 if (mutt_istr_equal(buf_string(token), "compose"))
161 {
162 if (!MoreArgs(line))
163 {
164 buf_printf(err, _("%s: too few arguments"), cmd->name);
165 buf_pool_release(&token);
166 return MUTT_CMD_WARNING;
167 }
168
169 struct Buffer *suffix = buf_pool_get();
170 parse_extract_token(suffix, line, TOKEN_NO_FLAGS);
171 buf_fix_dptr(token);
172 buf_add_printf(token, "_%s", buf_string(suffix));
173 buf_pool_release(&suffix);
174 }
175
176 int rc = mutt_map_get_value(buf_string(token), ColorFields);
177 if (rc == -1)
178 {
179 buf_printf(err, _("%s: no such object"), buf_string(token));
180 buf_pool_release(&token);
181 return MUTT_CMD_WARNING;
182 }
183 else
184 {
185 color_debug(LL_DEBUG5, "object: %s\n", mutt_map_get_name(rc, ColorFields));
186 }
187
188 *cid = rc;
189 buf_pool_release(&token);
190 return MUTT_CMD_SUCCESS;
191}
192
200 struct Buffer *line, struct Buffer *err)
201{
202 if (!MoreArgs(line))
203 {
204 buf_printf(err, _("%s: too few arguments"), cmd->name);
205 return MUTT_CMD_WARNING;
206 }
207
208 struct Buffer *token = buf_pool_get();
210
211 // Peek at the next token ('*' won't match a colour name)
212 if (line->dptr[0] == '*')
213 {
215 if (mutt_str_equal(buf_string(token), "*"))
216 {
217 colors_reset();
218 rc = MUTT_CMD_SUCCESS;
219 goto done;
220 }
221 }
222
223 unsigned int cid = MT_COLOR_NONE;
224 color_debug(LL_DEBUG5, "uncolor: %s\n", buf_string(token));
225 rc = parse_object(cmd, line, &cid, err);
226 if (rc != MUTT_CMD_SUCCESS)
227 goto done;
228
229 if (cid == -1)
230 {
231 buf_printf(err, _("%s: no such object"), buf_string(token));
232 rc = MUTT_CMD_ERROR;
233 goto done;
234 }
235
236 if ((cid == MT_COLOR_STATUS) && !MoreArgs(line))
237 {
238 color_debug(LL_DEBUG5, "simple\n");
239 simple_color_reset(cid); // default colour for the status bar
240 goto done;
241 }
242
243 if (!mutt_color_has_pattern(cid))
244 {
245 color_debug(LL_DEBUG5, "simple\n");
247 goto done;
248 }
249
250 if (!MoreArgs(line))
251 {
252 if (regex_colors_parse_uncolor(cid, NULL))
253 rc = MUTT_CMD_SUCCESS;
254 else
255 rc = MUTT_CMD_ERROR;
256 goto done;
257 }
258
259 do
260 {
262 if (mutt_str_equal("*", buf_string(token)))
263 {
264 if (regex_colors_parse_uncolor(cid, NULL))
265 rc = MUTT_CMD_SUCCESS;
266 else
267 rc = MUTT_CMD_ERROR;
268 goto done;
269 }
270
272
273 } while (MoreArgs(line));
274
275 rc = MUTT_CMD_SUCCESS;
276
277done:
278 buf_pool_release(&token);
279 return rc;
280}
281
294static enum CommandResult parse_color_command(const struct Command *cmd,
295 struct Buffer *line, struct Buffer *err,
296 parser_callback_t callback)
297{
298 if (!cmd || !line || !err)
299 return MUTT_CMD_ERROR;
300
301 unsigned int match = 0;
302 enum ColorId cid = MT_COLOR_NONE;
304 struct AttrColor *ac = NULL;
305 struct Buffer *token = buf_pool_get();
306
307 if (!MoreArgs(line))
308 {
309 if (StartupComplete)
310 {
311 color_dump();
312 rc = MUTT_CMD_SUCCESS;
313 }
314 else
315 {
316 buf_printf(err, _("%s: too few arguments"), cmd->name);
317 rc = MUTT_CMD_WARNING;
318 }
319
320 goto done;
321 }
322
323 rc = parse_object(cmd, line, &cid, err);
324 if (rc != MUTT_CMD_SUCCESS)
325 goto done;
326
327 ac = attr_color_new();
328 rc = callback(cmd, line, ac, err);
329 if (rc != MUTT_CMD_SUCCESS)
330 goto done;
331
332 //------------------------------------------------------------------
333 // Business Logic
334
335 rc = MUTT_CMD_ERROR;
336 if ((ac->fg.type == CT_RGB) || (ac->bg.type == CT_RGB))
337 {
338#ifndef NEOMUTT_DIRECT_COLORS
339 buf_printf(err, _("Direct colors support not compiled in: %s"), buf_string(line));
340 goto done;
341#endif
342
343 const bool c_color_directcolor = cs_subset_bool(NeoMutt->sub, "color_directcolor");
344 if (!c_color_directcolor)
345 {
346 buf_printf(err, _("Direct colors support disabled: %s"), buf_string(line));
347 goto done;
348 }
349 }
350
351 if ((ac->fg.color >= COLORS) || (ac->bg.color >= COLORS))
352 {
353 buf_printf(err, _("%s: color not supported by term"), buf_string(line));
354 goto done;
355 }
356
357 //------------------------------------------------------------------
358
359 /* extract a regular expression if needed */
360
361 if (mutt_color_has_pattern(cid) && (cid != MT_COLOR_STATUS))
362 {
363 color_debug(LL_DEBUG5, "regex needed\n");
364 if (MoreArgs(line))
365 {
367 }
368 else
369 {
370 buf_strcpy(token, ".*");
371 }
372 }
373
374 if (MoreArgs(line) && (cid != MT_COLOR_STATUS))
375 {
376 buf_printf(err, _("%s: too many arguments"), cmd->name);
377 rc = MUTT_CMD_WARNING;
378 goto done;
379 }
380
381 if (regex_colors_parse_color_list(cid, buf_string(token), ac, &rc, err))
382 {
383 color_debug(LL_DEBUG5, "regex_colors_parse_color_list done\n");
384 goto done;
385 // do nothing
386 }
387 else if ((cid == MT_COLOR_STATUS) && MoreArgs(line))
388 {
389 color_debug(LL_DEBUG5, "status\n");
390 /* 'color status fg bg' can have up to 2 arguments:
391 * 0 arguments: sets the default status color (handled below by else part)
392 * 1 argument : colorize pattern on match
393 * 2 arguments: colorize nth submatch of pattern */
395
396 if (MoreArgs(line))
397 {
398 struct Buffer *tmp = buf_pool_get();
400 if (!mutt_str_atoui_full(buf_string(tmp), &match))
401 {
402 buf_printf(err, _("%s: invalid number: %s"), cmd->name, buf_string(tmp));
403 buf_pool_release(&tmp);
404 rc = MUTT_CMD_WARNING;
405 goto done;
406 }
407 buf_pool_release(&tmp);
408 }
409
410 if (MoreArgs(line))
411 {
412 buf_printf(err, _("%s: too many arguments"), cmd->name);
413 rc = MUTT_CMD_WARNING;
414 goto done;
415 }
416
417 rc = regex_colors_parse_status_list(cid, buf_string(token), ac, match, err);
418 goto done;
419 }
420 else // Remaining simple colours
421 {
422 color_debug(LL_DEBUG5, "simple\n");
423 if (simple_color_set(cid, ac))
424 rc = MUTT_CMD_SUCCESS;
425 else
426 rc = MUTT_CMD_ERROR;
427 }
428
429 if (rc == MUTT_CMD_SUCCESS)
430 {
431 get_colorid_name(cid, token);
432 color_debug(LL_DEBUG5, "NT_COLOR_SET: %s\n", buf_string(token));
433 struct EventColor ev_c = { cid, NULL };
435 }
436
437done:
438 attr_color_free(&ac);
439 buf_pool_release(&token);
440 return rc;
441}
442
449enum CommandResult parse_uncolor(const struct Command *cmd, struct Buffer *line,
450 struct Buffer *err)
451{
452 if (!MoreArgs(line))
453 {
454 buf_printf(err, _("%s: too few arguments"), cmd->name);
455 return MUTT_CMD_WARNING;
456 }
457
458 struct Buffer *token = buf_pool_get();
460
461 if (!OptGui) // No GUI, so quietly discard the command
462 {
463 while (MoreArgs(line))
464 {
466 }
467 goto done;
468 }
469
470 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(token));
471 rc = parse_uncolor_command(cmd, line, err);
472 curses_colors_dump(token);
473
474done:
475 buf_pool_release(&token);
476 return rc;
477}
478
485enum CommandResult parse_unmono(const struct Command *cmd, struct Buffer *line,
486 struct Buffer *err)
487{
488 // Quietly discard the command
489 struct Buffer *token = buf_pool_get();
490 while (MoreArgs(line))
491 {
493 }
494 buf_pool_release(&token);
495
496 return MUTT_CMD_SUCCESS;
497}
498
505enum CommandResult parse_color(const struct Command *cmd, struct Buffer *line,
506 struct Buffer *err)
507{
508 struct Buffer *token = buf_pool_get();
510
511 // No GUI, or no colours, so quietly discard the command
512 if (!OptGui || (COLORS == 0))
513 {
514 while (MoreArgs(line))
515 {
517 }
518 goto done;
519 }
520
521 color_debug(LL_DEBUG5, "parse: color\n");
522 rc = parse_color_command(cmd, line, err, parse_color_pair);
523 curses_colors_dump(token);
524
525done:
526 buf_pool_release(&token);
527 return rc;
528}
529
536enum CommandResult parse_mono(const struct Command *cmd, struct Buffer *line,
537 struct Buffer *err)
538{
539 struct Buffer *token = buf_pool_get();
541
542 // No GUI, or colours available, so quietly discard the command
543 if (!OptGui || (COLORS != 0))
544 {
545 while (MoreArgs(line))
546 {
548 }
549 goto done;
550 }
551
552 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(token));
553 rc = parse_color_command(cmd, line, err, parse_attr_spec);
554 curses_colors_dump(token);
555
556done:
557 buf_pool_release(&token);
558 return rc;
559}
struct AttrColor * attr_color_new(void)
Create a new AttrColor.
Definition attr.c:89
void attr_color_free(struct AttrColor **ptr)
Free an AttrColor.
Definition attr.c:68
Colour and attributes.
@ CT_RGB
True colour, e.g. "#11AAFF".
Definition attr.h:38
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition buffer.c:161
int buf_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
Definition buffer.c:204
void buf_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
Definition buffer.c:182
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition buffer.c:226
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
void get_colorid_name(unsigned int cid, struct Buffer *buf)
Get the name of a Colour ID.
Definition commands.c:127
static enum CommandResult parse_object(const struct Command *cmd, struct Buffer *line, enum ColorId *cid, struct Buffer *err)
Identify a colour object.
Definition commands.c:146
static enum CommandResult parse_color_command(const struct Command *cmd, struct Buffer *line, struct Buffer *err, parser_callback_t callback)
Parse a 'color' command.
Definition commands.c:294
Parse colour commands.
enum CommandResult(* parser_callback_t)(const struct Command *cmd, struct Buffer *line, struct AttrColor *ac, struct Buffer *err)
Definition commands.h:49
void color_dump(void)
Display all the colours in the Pager.
Definition dump.c:450
Colour Dump Command.
struct Notify * ColorsNotify
Notifications: ColorId, EventColor.
Definition notify.c:36
int regex_colors_parse_status_list(enum ColorId cid, const char *pat, struct AttrColor *ac, int match, struct Buffer *err)
Parse a Regex 'color status' command.
Definition regex.c:397
bool regex_colors_parse_color_list(enum ColorId cid, const char *pat, struct AttrColor *ac, int *rc, struct Buffer *err)
Parse a Regex 'color' command.
Definition regex.c:336
bool regex_colors_parse_uncolor(enum ColorId cid, const char *pat)
Parse a Regex 'uncolor' command.
Definition regex.c:424
struct AttrColor * simple_color_set(enum ColorId cid, struct AttrColor *ac_val)
Set the colour of a simple object.
Definition simple.c:127
void simple_color_reset(enum ColorId cid)
Clear the colour of a simple object.
Definition simple.c:150
bool mutt_color_has_pattern(enum ColorId cid)
Check if a color object supports a regex pattern.
Definition color.c:98
void colors_reset(void)
Reset all the simple, quoted and regex colours.
Definition color.c:68
Color and attribute parsing.
const struct Mapping ColorFields[]
Mapping of colour names to their IDs.
Definition commands.c:54
ColorId
List of all coloured objects.
Definition color.h:36
@ MT_COLOR_SIDEBAR_DIVIDER
Line dividing sidebar from the index/pager.
Definition color.h:70
@ MT_COLOR_MARKERS
Pager: markers, line continuation.
Definition color.h:52
@ MT_COLOR_COMPOSE_SECURITY_ENCRYPT
Mail will be encrypted.
Definition color.h:44
@ MT_COLOR_MESSAGE
Informational message.
Definition color.h:53
@ MT_COLOR_INDEX_AUTHOR
Index: author field.
Definition color.h:88
@ MT_COLOR_QUOTED0
Pager: quoted text, level 0.
Definition color.h:58
@ MT_COLOR_SIDEBAR_NEW
Mailbox with new mail.
Definition color.h:74
@ MT_COLOR_HEADER
Message headers (takes a pattern)
Definition color.h:49
@ MT_COLOR_STATUS
Status bar (takes a pattern)
Definition color.h:79
@ MT_COLOR_SIDEBAR_UNREAD
Mailbox with unread mail.
Definition color.h:77
@ MT_COLOR_INDEX_SIZE
Index: size field.
Definition color.h:94
@ MT_COLOR_INDICATOR
Selected item in list.
Definition color.h:50
@ MT_COLOR_STRIPE_EVEN
Stripes: even lines of the Help Page.
Definition color.h:80
@ MT_COLOR_SIDEBAR_SPOOLFILE
$spool_file (Spool mailbox)
Definition color.h:76
@ MT_COLOR_ERROR
Error message.
Definition color.h:47
@ MT_COLOR_NONE
No colour.
Definition color.h:37
@ MT_COLOR_COMPOSE_SECURITY_NONE
Mail will not be encrypted or signed.
Definition color.h:45
@ MT_COLOR_SIDEBAR_ORDINARY
Mailbox with no new or flagged messages.
Definition color.h:75
@ MT_COLOR_QUOTED1
Pager: quoted text, level 1.
Definition color.h:59
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
Definition color.h:97
@ MT_COLOR_QUOTED3
Pager: quoted text, level 3.
Definition color.h:61
@ MT_COLOR_BOLD
Bold text.
Definition color.h:41
@ MT_COLOR_INDEX_SUBJECT
Index: subject field.
Definition color.h:95
@ MT_COLOR_BODY
Pager: highlight body of message (takes a pattern)
Definition color.h:40
@ MT_COLOR_INDEX_DATE
Index: date field.
Definition color.h:90
@ MT_COLOR_QUOTED6
Pager: quoted text, level 6.
Definition color.h:64
@ MT_COLOR_PROGRESS
Progress bar.
Definition color.h:56
@ MT_COLOR_COMPOSE_SECURITY_BOTH
Mail will be encrypted and signed.
Definition color.h:43
@ MT_COLOR_QUOTED8
Pager: quoted text, level 8.
Definition color.h:66
@ MT_COLOR_SIDEBAR_BACKGROUND
Background colour for the Sidebar.
Definition color.h:69
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
Definition color.h:96
@ MT_COLOR_HDRDEFAULT
Header default colour.
Definition color.h:48
@ MT_COLOR_OPTIONS
Options in prompt.
Definition color.h:55
@ MT_COLOR_TREE
Index: tree-drawing characters.
Definition color.h:83
@ MT_COLOR_QUOTED7
Pager: quoted text, level 7.
Definition color.h:65
@ MT_COLOR_NORMAL
Plain text.
Definition color.h:54
@ MT_COLOR_ATTACH_HEADERS
MIME attachment test (takes a pattern)
Definition color.h:39
@ MT_COLOR_SEARCH
Pager: search matches.
Definition color.h:68
@ MT_COLOR_COMPOSE_SECURITY_SIGN
Mail will be signed.
Definition color.h:46
@ MT_COLOR_INDEX_LABEL
Index: label field.
Definition color.h:92
@ MT_COLOR_ITALIC
Italic text.
Definition color.h:51
@ MT_COLOR_QUOTED4
Pager: quoted text, level 4.
Definition color.h:62
@ MT_COLOR_STRIPE_ODD
Stripes: odd lines of the Help Page.
Definition color.h:81
@ MT_COLOR_PROMPT
Question/user input.
Definition color.h:57
@ MT_COLOR_COMPOSE_HEADER
Header labels, e.g. From:
Definition color.h:42
@ MT_COLOR_INDEX
Index: default colour.
Definition color.h:87
@ MT_COLOR_QUOTED9
Pager: quoted text, level 9.
Definition color.h:67
@ MT_COLOR_QUOTED2
Pager: quoted text, level 2.
Definition color.h:60
@ MT_COLOR_ATTACHMENT
MIME attachments text (entire line)
Definition color.h:38
@ MT_COLOR_SIDEBAR_INDICATOR
Current open mailbox.
Definition color.h:73
@ MT_COLOR_SIDEBAR_HIGHLIGHT
Select cursor.
Definition color.h:72
@ MT_COLOR_WARNING
Warning messages.
Definition color.h:85
@ MT_COLOR_UNDERLINE
Underlined text.
Definition color.h:84
@ MT_COLOR_INDEX_NUMBER
Index: index number.
Definition color.h:93
@ MT_COLOR_SIGNATURE
Pager: signature lines.
Definition color.h:78
@ MT_COLOR_INDEX_FLAGS
Index: flags field.
Definition color.h:91
@ MT_COLOR_QUOTED5
Pager: quoted text, level 5.
Definition color.h:63
@ MT_COLOR_SIDEBAR_FLAGGED
Mailbox with flagged messages.
Definition color.h:71
@ MT_COLOR_TILDE
Pager: empty lines after message.
Definition color.h:82
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
Definition color.h:89
CommandResult
Error codes for command_t parse functions.
Definition command.h:35
@ MUTT_CMD_SUCCESS
Success: Command worked.
Definition command.h:38
@ MUTT_CMD_ERROR
Error: Can't help the user.
Definition command.h:36
@ MUTT_CMD_WARNING
Warning: Help given to the user.
Definition command.h:37
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
Convenience wrapper for the config headers.
bool StartupComplete
When the config has been read.
Definition address.c:13
Convenience wrapper for the core headers.
void curses_colors_dump(struct Buffer *buf)
Dump all the Curses colours.
Definition debug.c:143
Colour Debugging.
static int color_debug(enum LogLevel level, const char *format,...)
Definition debug.h:52
int parse_extract_token(struct Buffer *dest, struct Buffer *line, TokenFlags flags)
Extract one token from a string.
Definition extract.c:48
#define MoreArgsF(buf, flags)
Definition extract.h:33
#define MoreArgs(buf)
Definition extract.h:30
#define TOKEN_COMMENT
Don't reap comments.
Definition extract.h:50
#define TOKEN_NO_FLAGS
No flags are set.
Definition extract.h:44
bool OptGui
(pseudo) when the gui (and curses) are started
Definition globals.c:59
enum CommandResult parse_mono(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'mono' command - Implements Command::parse() -.
Definition commands.c:536
enum CommandResult parse_unmono(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'unmono' command - Implements Command::parse() -.
Definition commands.c:485
enum CommandResult parse_uncolor_command(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse an 'uncolor' command - Implements Command::parse() -.
Definition commands.c:199
enum CommandResult parse_color(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'color' command - Implements Command::parse() -.
Definition commands.c:505
enum CommandResult parse_uncolor(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'uncolor' command - Implements Command::parse() -.
Definition commands.c:449
enum CommandResult parse_color_pair(const struct Command *cmd, struct Buffer *line, struct AttrColor *ac, struct Buffer *err)
Parse a pair of colours - Implements parser_callback_t -.
enum CommandResult parse_attr_spec(const struct Command *cmd, struct Buffer *line, struct AttrColor *ac, struct Buffer *err)
Parse an attribute description - Implements parser_callback_t -.
Convenience wrapper for the gui headers.
@ LL_DEBUG5
Log at debug level 5.
Definition logging2.h:48
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.
Definition mapping.c:85
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Definition mapping.c:42
Convenience wrapper for the library headers.
#define _(a)
Definition message.h:28
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition notify.c:173
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition string.c:672
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition string.c:660
Many unsorted constants and some structs.
Colour notifications.
@ NT_COLOR_SET
Color has been set.
Definition notify2.h:43
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
Definition notify_type.h:41
Text parsing functions.
Parse colour commands.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:82
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:96
Regex Colour.
Simple colour.
A curses colour and its attributes.
Definition attr.h:66
struct ColorElement bg
Background colour.
Definition attr.h:68
struct ColorElement fg
Foreground colour.
Definition attr.h:67
String manipulation buffer.
Definition buffer.h:36
char * dptr
Current read/write position.
Definition buffer.h:38
enum ColorType type
Type of Colour.
Definition attr.h:58
color_t color
Colour.
Definition attr.h:57
const char * name
Name of the command.
Definition command.h:59
An Event that happened to a Colour.
Definition notify2.h:55
enum ColorId cid
Colour ID that has changed.
Definition notify2.h:56
Mapping between user-readable string and a constant.
Definition mapping.h:33
const char * name
String value.
Definition mapping.h:34
Container for Accounts, Notifications.
Definition neomutt.h:43
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:47