NeoMutt  2025-12-11-769-g906513
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 "module_data.h"
47#include "notify2.h"
48#include "parse_color.h"
49#include "regex4.h"
50#include "simple2.h"
51
55const struct Mapping ColorFields[] = {
56 // clang-format off
57 { "attachment", MT_COLOR_ATTACHMENT },
58 { "attach_headers", MT_COLOR_ATTACH_HEADERS },
59 { "body", MT_COLOR_BODY },
60 { "bold", MT_COLOR_BOLD },
61 { "compose_header", MT_COLOR_COMPOSE_HEADER },
62 { "compose_security_both", MT_COLOR_COMPOSE_SECURITY_BOTH },
63 { "compose_security_encrypt", MT_COLOR_COMPOSE_SECURITY_ENCRYPT },
64 { "compose_security_none", MT_COLOR_COMPOSE_SECURITY_NONE },
65 { "compose_security_sign", MT_COLOR_COMPOSE_SECURITY_SIGN },
66 { "error", MT_COLOR_ERROR },
67 { "hdrdefault", MT_COLOR_HDRDEFAULT },
68 { "header", MT_COLOR_HEADER },
69 { "index", MT_COLOR_INDEX },
70 { "index_author", MT_COLOR_INDEX_AUTHOR },
71 { "index_collapsed", MT_COLOR_INDEX_COLLAPSED },
72 { "index_date", MT_COLOR_INDEX_DATE },
73 { "index_flags", MT_COLOR_INDEX_FLAGS },
74 { "index_label", MT_COLOR_INDEX_LABEL },
75 { "index_number", MT_COLOR_INDEX_NUMBER },
76 { "index_size", MT_COLOR_INDEX_SIZE },
77 { "index_subject", MT_COLOR_INDEX_SUBJECT },
78 { "index_tag", MT_COLOR_INDEX_TAG },
79 { "index_tags", MT_COLOR_INDEX_TAGS },
80 { "indicator", MT_COLOR_INDICATOR },
81 { "italic", MT_COLOR_ITALIC },
82 { "markers", MT_COLOR_MARKERS },
83 { "message", MT_COLOR_MESSAGE },
84 { "normal", MT_COLOR_NORMAL },
85 { "options", MT_COLOR_OPTIONS },
86 { "progress", MT_COLOR_PROGRESS },
87 { "prompt", MT_COLOR_PROMPT },
88 { "quoted0", MT_COLOR_QUOTED0 },
89 { "quoted1", MT_COLOR_QUOTED1 },
90 { "quoted2", MT_COLOR_QUOTED2 },
91 { "quoted3", MT_COLOR_QUOTED3 },
92 { "quoted4", MT_COLOR_QUOTED4 },
93 { "quoted5", MT_COLOR_QUOTED5 },
94 { "quoted6", MT_COLOR_QUOTED6 },
95 { "quoted7", MT_COLOR_QUOTED7 },
96 { "quoted8", MT_COLOR_QUOTED8 },
97 { "quoted9", MT_COLOR_QUOTED9 },
98 { "search", MT_COLOR_SEARCH },
99 { "sidebar_background", MT_COLOR_SIDEBAR_BACKGROUND },
100 { "sidebar_divider", MT_COLOR_SIDEBAR_DIVIDER },
101 { "sidebar_flagged", MT_COLOR_SIDEBAR_FLAGGED },
102 { "sidebar_highlight", MT_COLOR_SIDEBAR_HIGHLIGHT },
103 { "sidebar_indicator", MT_COLOR_SIDEBAR_INDICATOR },
104 { "sidebar_new", MT_COLOR_SIDEBAR_NEW },
105 { "sidebar_ordinary", MT_COLOR_SIDEBAR_ORDINARY },
106 { "sidebar_spool_file", MT_COLOR_SIDEBAR_SPOOL_FILE },
107 { "sidebar_unread", MT_COLOR_SIDEBAR_UNREAD },
108 { "signature", MT_COLOR_SIGNATURE },
109 { "status", MT_COLOR_STATUS },
110 { "stripe_even", MT_COLOR_STRIPE_EVEN},
111 { "stripe_odd", MT_COLOR_STRIPE_ODD},
112 { "tilde", MT_COLOR_TILDE },
113 { "tree", MT_COLOR_TREE },
114 { "underline", MT_COLOR_UNDERLINE },
115 { "warning", MT_COLOR_WARNING },
116 // Deprecated
117 { "quoted", MT_COLOR_QUOTED0 },
118 { "sidebar_spoolfile", MT_COLOR_SIDEBAR_SPOOL_FILE },
119 { NULL, 0 },
120 // clang-format on
121};
122
128void get_colorid_name(unsigned int cid, struct Buffer *buf)
129{
130 const char *name = mutt_map_get_name(cid, ColorFields);
131 if (name)
132 buf_addstr(buf, name);
133 else
134 buf_printf(buf, "UNKNOWN %d", cid);
135}
136
147static enum CommandResult parse_object(const struct Command *cmd, struct Buffer *line,
148 enum ColorId *cid, struct Buffer *err)
149{
150 if (!MoreArgsF(line, TOKEN_COMMENT))
151 {
152 buf_printf(err, _("%s: too few arguments"), cmd->name);
153 return MUTT_CMD_WARNING;
154 }
155
156 struct Buffer *token = buf_pool_get();
157
159 color_debug(LL_DEBUG5, "color: %s\n", buf_string(token));
160
161 if (mutt_istr_equal(buf_string(token), "compose"))
162 {
163 if (!MoreArgs(line))
164 {
165 buf_printf(err, _("%s: too few arguments"), cmd->name);
166 buf_pool_release(&token);
167 return MUTT_CMD_WARNING;
168 }
169
170 struct Buffer *suffix = buf_pool_get();
171 parse_extract_token(suffix, line, TOKEN_NO_FLAGS);
172 buf_fix_dptr(token);
173 buf_add_printf(token, "_%s", buf_string(suffix));
174 buf_pool_release(&suffix);
175 }
176
177 int rc = mutt_map_get_value(buf_string(token), ColorFields);
178 if (rc == -1)
179 {
180 buf_printf(err, _("%s: no such object"), buf_string(token));
181 buf_pool_release(&token);
182 return MUTT_CMD_WARNING;
183 }
184 else
185 {
186 color_debug(LL_DEBUG5, "object: %s\n", mutt_map_get_name(rc, ColorFields));
187 }
188
189 *cid = rc;
190 buf_pool_release(&token);
191 return MUTT_CMD_SUCCESS;
192}
193
200enum CommandResult parse_uncolor_command(const struct Command *cmd, struct Buffer *line,
201 const struct ParseContext *pc,
202 struct ParseError *pe)
203{
204 struct Buffer *err = pe->message;
205
206 if (!MoreArgs(line))
207 {
208 buf_printf(err, _("%s: too few arguments"), cmd->name);
209 return MUTT_CMD_WARNING;
210 }
211
212 struct Buffer *token = buf_pool_get();
214
215 // Peek at the next token ('*' won't match a colour name)
216 if (line->dptr[0] == '*')
217 {
219 if (mutt_str_equal(buf_string(token), "*"))
220 {
221 colors_reset();
222 rc = MUTT_CMD_SUCCESS;
223 goto done;
224 }
225 }
226
227 enum ColorId cid = MT_COLOR_NONE;
228 color_debug(LL_DEBUG5, "uncolor: %s\n", buf_string(token));
229 rc = parse_object(cmd, line, &cid, err);
230 if (rc != MUTT_CMD_SUCCESS)
231 goto done;
232
233 if ((cid == MT_COLOR_STATUS) && !MoreArgs(line))
234 {
235 color_debug(LL_DEBUG5, "simple\n");
236 simple_color_reset(cid); // default colour for the status bar
237 goto done;
238 }
239
240 if (!mutt_color_has_pattern(cid))
241 {
242 color_debug(LL_DEBUG5, "simple\n");
244 goto done;
245 }
246
247 if (!MoreArgs(line))
248 {
249 if (regex_colors_parse_uncolor(cid, NULL))
250 rc = MUTT_CMD_SUCCESS;
251 else
252 rc = MUTT_CMD_ERROR;
253 goto done;
254 }
255
256 do
257 {
259 if (mutt_str_equal("*", buf_string(token)))
260 {
261 if (regex_colors_parse_uncolor(cid, NULL))
262 rc = MUTT_CMD_SUCCESS;
263 else
264 rc = MUTT_CMD_ERROR;
265 goto done;
266 }
267
269
270 } while (MoreArgs(line));
271
272 rc = MUTT_CMD_SUCCESS;
273
274done:
275 buf_pool_release(&token);
276 return rc;
277}
278
291static enum CommandResult parse_color_command(const struct Command *cmd,
292 struct Buffer *line, struct Buffer *err,
293 parser_callback_t callback)
294{
295 if (!cmd || !line || !err)
296 return MUTT_CMD_ERROR;
297
298 unsigned int match = 0;
299 enum ColorId cid = MT_COLOR_NONE;
301 struct AttrColor *ac = NULL;
302 struct Buffer *token = buf_pool_get();
303
304 if (!MoreArgs(line))
305 {
306 if (StartupComplete)
307 {
308 color_dump();
309 rc = MUTT_CMD_SUCCESS;
310 }
311 else
312 {
313 buf_printf(err, _("%s: too few arguments"), cmd->name);
314 rc = MUTT_CMD_WARNING;
315 }
316
317 goto done;
318 }
319
320 rc = parse_object(cmd, line, &cid, err);
321 if (rc != MUTT_CMD_SUCCESS)
322 goto done;
323
324 ac = attr_color_new();
325 rc = callback(cmd, line, ac, err);
326 if (rc != MUTT_CMD_SUCCESS)
327 goto done;
328
329 //------------------------------------------------------------------
330 // Business Logic
331
332 rc = MUTT_CMD_ERROR;
333 if ((ac->fg.type == CT_RGB) || (ac->bg.type == CT_RGB))
334 {
335#ifndef NEOMUTT_DIRECT_COLORS
336 buf_printf(err, _("Direct colors support not compiled in: %s"), buf_string(line));
337 goto done;
338#endif
339
340 const bool c_color_directcolor = cs_subset_bool(NeoMutt->sub, "color_directcolor");
341 if (!c_color_directcolor)
342 {
343 buf_printf(err, _("Direct colors support disabled: %s"), buf_string(line));
344 goto done;
345 }
346 }
347
348 if ((ac->fg.color >= COLORS) || (ac->bg.color >= COLORS))
349 {
350 buf_printf(err, _("%s: color not supported by term"), buf_string(line));
351 goto done;
352 }
353
354 //------------------------------------------------------------------
355
356 /* extract a regular expression if needed */
357
358 if (mutt_color_has_pattern(cid) && (cid != MT_COLOR_STATUS))
359 {
360 color_debug(LL_DEBUG5, "regex needed\n");
361 if (MoreArgs(line))
362 {
364 }
365 else
366 {
367 buf_strcpy(token, ".*");
368 }
369 }
370
371 if (MoreArgs(line) && (cid != MT_COLOR_STATUS))
372 {
373 buf_printf(err, _("%s: too many arguments"), cmd->name);
374 rc = MUTT_CMD_WARNING;
375 goto done;
376 }
377
378 if (regex_colors_parse_color_list(cid, buf_string(token), ac, &rc, err))
379 {
380 color_debug(LL_DEBUG5, "regex_colors_parse_color_list done\n");
381 goto done;
382 // do nothing
383 }
384 else if ((cid == MT_COLOR_STATUS) && MoreArgs(line))
385 {
386 color_debug(LL_DEBUG5, "status\n");
387 /* 'color status fg bg' can have up to 2 arguments:
388 * 0 arguments: sets the default status color (handled below by else part)
389 * 1 argument : colorize pattern on match
390 * 2 arguments: colorize nth submatch of pattern */
392
393 if (MoreArgs(line))
394 {
395 struct Buffer *tmp = buf_pool_get();
397 if (!mutt_str_atoui_full(buf_string(tmp), &match))
398 {
399 buf_printf(err, _("%s: invalid number: %s"), cmd->name, buf_string(tmp));
400 buf_pool_release(&tmp);
401 rc = MUTT_CMD_WARNING;
402 goto done;
403 }
404 buf_pool_release(&tmp);
405 }
406
407 if (MoreArgs(line))
408 {
409 buf_printf(err, _("%s: too many arguments"), cmd->name);
410 rc = MUTT_CMD_WARNING;
411 goto done;
412 }
413
414 rc = regex_colors_parse_status_list(cid, buf_string(token), ac, match, err);
415 goto done;
416 }
417 else // Remaining simple colours
418 {
419 color_debug(LL_DEBUG5, "simple\n");
420 if (simple_color_set(cid, ac))
421 rc = MUTT_CMD_SUCCESS;
422 else
423 rc = MUTT_CMD_ERROR;
424 }
425
426 if (rc == MUTT_CMD_SUCCESS)
427 {
428 get_colorid_name(cid, token);
429 color_debug(LL_DEBUG5, "NT_COLOR_SET: %s\n", buf_string(token));
431 struct EventColor ev_c = { cid, NULL };
433 }
434
435done:
436 attr_color_free(&ac);
437 buf_pool_release(&token);
438 return rc;
439}
440
447enum CommandResult parse_uncolor(const struct Command *cmd, struct Buffer *line,
448 const struct ParseContext *pc, struct ParseError *pe)
449{
450 struct Buffer *err = pe->message;
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, pc, pe);
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 const struct ParseContext *pc, struct ParseError *pe)
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
507enum CommandResult parse_color(const struct Command *cmd, struct Buffer *line,
508 const struct ParseContext *pc, struct ParseError *pe)
509{
510 struct Buffer *err = pe->message;
511
512 struct Buffer *token = buf_pool_get();
514
515 // No GUI, or no colours, so quietly discard the command
516 if (!OptGui || (COLORS == 0))
517 {
518 while (MoreArgs(line))
519 {
521 }
522 goto done;
523 }
524
525 color_debug(LL_DEBUG5, "parse: color\n");
526 rc = parse_color_command(cmd, line, err, parse_color_pair);
527 curses_colors_dump(token);
528
529done:
530 buf_pool_release(&token);
531 return rc;
532}
533
540enum CommandResult parse_mono(const struct Command *cmd, struct Buffer *line,
541 const struct ParseContext *pc, struct ParseError *pe)
542{
543 struct Buffer *err = pe->message;
544
545 struct Buffer *token = buf_pool_get();
547
548 // No GUI, or colours available, so quietly discard the command
549 if (!OptGui || (COLORS != 0))
550 {
551 while (MoreArgs(line))
552 {
554 }
555 goto done;
556 }
557
558 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(token));
559 rc = parse_color_command(cmd, line, err, parse_attr_spec);
560 curses_colors_dump(token);
561
562done:
563 buf_pool_release(&token);
564 return rc;
565}
566
570const struct Command ColorCommands[] = {
571 // clang-format off
572 { "color", CMD_COLOR, parse_color,
573 N_("Define colors for the user interface"),
574 N_("color <object> [ <attribute> ... ] <fg> <bg> [ <regex> [ <num> ]]"),
575 "configuration.html#color" },
576 { "mono", CMD_MONO, parse_mono,
577 N_("Deprecated: Use `color` instead"),
578 N_("mono <object> <attribute> [ <pattern> | <regex> ]"),
579 "configuration.html#color-mono" },
580 { "uncolor", CMD_UNCOLOR, parse_uncolor,
581 N_("Remove a `color` definition"),
582 N_("uncolor <object> { * | <pattern> ... }"),
583 "configuration.html#color" },
584 { "unmono", CMD_UNMONO, parse_unmono,
585 N_("Deprecated: Use `uncolor` instead"),
586 N_("unmono <object> { * | <pattern> ... }"),
587 "configuration.html#color-mono" },
588
589 { NULL, CMD_NONE, NULL, NULL, NULL, NULL, CF_NO_FLAGS },
590 // clang-format on
591};
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:37
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:128
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:147
const struct Command ColorCommands[]
Colour Commands.
Definition commands.c:570
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:291
Parse colour commands.
enum CommandResult(* parser_callback_t)(const struct Command *cmd, struct Buffer *line, struct AttrColor *ac, struct Buffer *err)
Definition commands.h:50
void color_dump(void)
Display all the colours in the Pager.
Definition dump.c:450
Colour Dump Command.
Color private Module data.
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:386
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:324
bool regex_colors_parse_uncolor(enum ColorId cid, const char *pat)
Parse a Regex 'uncolor' command.
Definition regex.c:414
struct AttrColor * simple_color_set(enum ColorId cid, struct AttrColor *ac_val)
Set the colour of a simple object.
Definition simple.c:130
void simple_color_reset(enum ColorId cid)
Clear the colour of a simple object.
Definition simple.c:154
bool mutt_color_has_pattern(enum ColorId cid)
Check if a color object supports a regex pattern.
Definition color.c:100
void colors_reset(void)
Reset all the simple, quoted and regex colours.
Definition color.c:69
Color and attribute parsing.
const struct Mapping ColorFields[]
Mapping of colour names to their IDs.
Definition commands.c:55
ColorId
List of all coloured objects.
Definition color.h:35
@ MT_COLOR_SIDEBAR_SPOOL_FILE
$spool_file (Spool mailbox)
Definition color.h:75
@ MT_COLOR_SIDEBAR_DIVIDER
Line dividing sidebar from the index/pager.
Definition color.h:69
@ MT_COLOR_MARKERS
Pager: markers, line continuation.
Definition color.h:51
@ MT_COLOR_COMPOSE_SECURITY_ENCRYPT
Mail will be encrypted.
Definition color.h:43
@ MT_COLOR_MESSAGE
Informational message.
Definition color.h:52
@ MT_COLOR_INDEX_AUTHOR
Index: author field.
Definition color.h:87
@ MT_COLOR_QUOTED0
Pager: quoted text, level 0.
Definition color.h:57
@ MT_COLOR_SIDEBAR_NEW
Mailbox with new mail.
Definition color.h:73
@ MT_COLOR_HEADER
Message headers (takes a pattern)
Definition color.h:48
@ MT_COLOR_STATUS
Status bar (takes a pattern)
Definition color.h:78
@ MT_COLOR_SIDEBAR_UNREAD
Mailbox with unread mail.
Definition color.h:76
@ MT_COLOR_INDEX_SIZE
Index: size field.
Definition color.h:93
@ MT_COLOR_INDICATOR
Selected item in list.
Definition color.h:49
@ MT_COLOR_STRIPE_EVEN
Stripes: even lines of the Help Page.
Definition color.h:79
@ MT_COLOR_ERROR
Error message.
Definition color.h:46
@ MT_COLOR_NONE
No colour.
Definition color.h:36
@ MT_COLOR_COMPOSE_SECURITY_NONE
Mail will not be encrypted or signed.
Definition color.h:44
@ MT_COLOR_SIDEBAR_ORDINARY
Mailbox with no new or flagged messages.
Definition color.h:74
@ MT_COLOR_QUOTED1
Pager: quoted text, level 1.
Definition color.h:58
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
Definition color.h:96
@ MT_COLOR_QUOTED3
Pager: quoted text, level 3.
Definition color.h:60
@ MT_COLOR_BOLD
Bold text.
Definition color.h:40
@ MT_COLOR_INDEX_SUBJECT
Index: subject field.
Definition color.h:94
@ MT_COLOR_BODY
Pager: highlight body of message (takes a pattern)
Definition color.h:39
@ MT_COLOR_INDEX_DATE
Index: date field.
Definition color.h:89
@ MT_COLOR_QUOTED6
Pager: quoted text, level 6.
Definition color.h:63
@ MT_COLOR_PROGRESS
Progress bar.
Definition color.h:55
@ MT_COLOR_COMPOSE_SECURITY_BOTH
Mail will be encrypted and signed.
Definition color.h:42
@ MT_COLOR_QUOTED8
Pager: quoted text, level 8.
Definition color.h:65
@ MT_COLOR_SIDEBAR_BACKGROUND
Background colour for the Sidebar.
Definition color.h:68
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
Definition color.h:95
@ MT_COLOR_HDRDEFAULT
Header default colour.
Definition color.h:47
@ MT_COLOR_OPTIONS
Options in prompt.
Definition color.h:54
@ MT_COLOR_TREE
Index: tree-drawing characters.
Definition color.h:82
@ MT_COLOR_QUOTED7
Pager: quoted text, level 7.
Definition color.h:64
@ MT_COLOR_NORMAL
Plain text.
Definition color.h:53
@ MT_COLOR_ATTACH_HEADERS
MIME attachment test (takes a pattern)
Definition color.h:38
@ MT_COLOR_SEARCH
Pager: search matches.
Definition color.h:67
@ MT_COLOR_COMPOSE_SECURITY_SIGN
Mail will be signed.
Definition color.h:45
@ MT_COLOR_INDEX_LABEL
Index: label field.
Definition color.h:91
@ MT_COLOR_ITALIC
Italic text.
Definition color.h:50
@ MT_COLOR_QUOTED4
Pager: quoted text, level 4.
Definition color.h:61
@ MT_COLOR_STRIPE_ODD
Stripes: odd lines of the Help Page.
Definition color.h:80
@ MT_COLOR_PROMPT
Question/user input.
Definition color.h:56
@ MT_COLOR_COMPOSE_HEADER
Header labels, e.g. From:
Definition color.h:41
@ MT_COLOR_INDEX
Index: default colour.
Definition color.h:86
@ MT_COLOR_QUOTED9
Pager: quoted text, level 9.
Definition color.h:66
@ MT_COLOR_QUOTED2
Pager: quoted text, level 2.
Definition color.h:59
@ MT_COLOR_ATTACHMENT
MIME attachments text (entire line)
Definition color.h:37
@ MT_COLOR_SIDEBAR_INDICATOR
Current open mailbox.
Definition color.h:72
@ MT_COLOR_SIDEBAR_HIGHLIGHT
Select cursor.
Definition color.h:71
@ MT_COLOR_WARNING
Warning messages.
Definition color.h:84
@ MT_COLOR_UNDERLINE
Underlined text.
Definition color.h:83
@ MT_COLOR_INDEX_NUMBER
Index: index number.
Definition color.h:92
@ MT_COLOR_SIGNATURE
Pager: signature lines.
Definition color.h:77
@ MT_COLOR_INDEX_FLAGS
Index: flags field.
Definition color.h:90
@ MT_COLOR_QUOTED5
Pager: quoted text, level 5.
Definition color.h:62
@ MT_COLOR_SIDEBAR_FLAGGED
Mailbox with flagged messages.
Definition color.h:70
@ MT_COLOR_TILDE
Pager: empty lines after message.
Definition color.h:81
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
Definition color.h:88
#define CF_NO_FLAGS
No flags are set.
Definition command.h:48
@ CMD_UNCOLOR
:uncolor
Definition command.h:129
@ CMD_COLOR
:color
Definition command.h:71
@ CMD_NONE
No Command.
Definition command.h:59
@ CMD_MONO
:mono
Definition command.h:96
@ CMD_UNMONO
:unmono
Definition command.h:139
CommandResult
Error codes for command_t parse functions.
Definition command.h:37
@ MUTT_CMD_SUCCESS
Success: Command worked.
Definition command.h:40
@ MUTT_CMD_ERROR
Error: Can't help the user.
Definition command.h:38
@ MUTT_CMD_WARNING
Warning: Help given to the user.
Definition command.h:39
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:11
Convenience wrapper for the core headers.
void curses_colors_dump(struct Buffer *buf)
Dump all the Curses colours.
Definition debug.c:142
Colour Debugging.
static int color_debug(enum LogLevel level, const char *format,...)
Definition debug.h:51
int parse_extract_token(struct Buffer *dest, struct Buffer *line, TokenFlags flags)
Extract one token from a string.
Definition extract.c:49
#define MoreArgsF(buf, flags)
Definition extract.h:34
#define MoreArgs(buf)
Definition extract.h:31
#define TOKEN_COMMENT
Don't reap comments.
Definition extract.h:51
#define TOKEN_NO_FLAGS
No flags are set.
Definition extract.h:45
bool OptGui
(pseudo) when the gui (and curses) are started
Definition globals.c:48
Global variables.
enum CommandResult parse_uncolor(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'uncolor' command - Implements Command::parse() -.
Definition commands.c:447
enum CommandResult parse_unmono(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'unmono' command - Implements Command::parse() -.
Definition commands.c:485
enum CommandResult parse_mono(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'mono' command - Implements Command::parse() -.
Definition commands.c:540
enum CommandResult parse_uncolor_command(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse an 'uncolor' command - Implements Command::parse() -.
Definition commands.c:200
enum CommandResult parse_color(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'color' command - Implements Command::parse() -.
Definition commands.c:507
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:49
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
@ MODULE_ID_COLOR
ModuleColor, Color
Definition module_api.h:53
Convenience wrapper for the library headers.
#define N_(a)
Definition message.h:32
#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:677
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition string.c:665
Many unsorted constants and some structs.
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:665
Colour notifications.
@ NT_COLOR_SET
Color has been set.
Definition notify2.h:40
@ 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:91
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:111
Regex Colour.
Simple colour.
A curses colour and its attributes.
Definition attr.h:65
struct ColorElement bg
Background colour.
Definition attr.h:67
struct ColorElement fg
Foreground colour.
Definition attr.h:66
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:57
color_t color
Colour.
Definition attr.h:56
Color private Module data.
Definition module_data.h:35
struct Notify * colors_notify
Notifications: ColorId, EventColor.
Definition module_data.h:40
const char * name
Name of the Command.
Definition command.h:159
An Event that happened to a Colour.
Definition notify2.h:52
enum ColorId cid
Colour ID that has changed.
Definition notify2.h:53
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:41
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
Context for config parsing (history/backtrace)
Definition pcontext.h:34
Detailed error information from config parsing.
Definition perror.h:34
struct Buffer * message
Error message.
Definition perror.h:35