NeoMutt  2025-12-11-949-g4870ee
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
158 parse_extract_token(token, line, TOKEN_NONE);
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_NONE);
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 {
218 parse_extract_token(token, line, TOKEN_NONE);
219 if (mutt_str_equal(buf_string(token), "*"))
220 {
222 colors_reset(mod_data);
223 rc = MUTT_CMD_SUCCESS;
224 goto done;
225 }
226 }
227
228 enum ColorId cid = MT_COLOR_NONE;
229 color_debug(LL_DEBUG5, "uncolor: %s\n", buf_string(token));
230 rc = parse_object(cmd, line, &cid, err);
231 if (rc != MUTT_CMD_SUCCESS)
232 goto done;
233
234 if ((cid == MT_COLOR_STATUS) && !MoreArgs(line))
235 {
236 color_debug(LL_DEBUG5, "simple\n");
237 simple_color_reset(cid); // default colour for the status bar
238 goto done;
239 }
240
241 if (!mutt_color_has_pattern(cid))
242 {
243 color_debug(LL_DEBUG5, "simple\n");
245 goto done;
246 }
247
248 if (!MoreArgs(line))
249 {
250 if (regex_colors_parse_uncolor(cid, NULL))
251 rc = MUTT_CMD_SUCCESS;
252 else
253 rc = MUTT_CMD_ERROR;
254 goto done;
255 }
256
257 do
258 {
259 parse_extract_token(token, line, TOKEN_NONE);
260 if (mutt_str_equal("*", buf_string(token)))
261 {
262 if (regex_colors_parse_uncolor(cid, NULL))
263 rc = MUTT_CMD_SUCCESS;
264 else
265 rc = MUTT_CMD_ERROR;
266 goto done;
267 }
268
270
271 } while (MoreArgs(line));
272
273 rc = MUTT_CMD_SUCCESS;
274
275done:
276 buf_pool_release(&token);
277 return rc;
278}
279
292static enum CommandResult parse_color_command(const struct Command *cmd,
293 struct Buffer *line, struct Buffer *err,
294 parser_callback_t callback)
295{
296 if (!cmd || !line || !err)
297 return MUTT_CMD_ERROR;
298
299 unsigned int match = 0;
300 enum ColorId cid = MT_COLOR_NONE;
302 struct AttrColor *ac = NULL;
303 struct Buffer *token = buf_pool_get();
304
305 if (!MoreArgs(line))
306 {
307 if (StartupComplete)
308 {
309 color_dump();
310 rc = MUTT_CMD_SUCCESS;
311 }
312 else
313 {
314 buf_printf(err, _("%s: too few arguments"), cmd->name);
315 rc = MUTT_CMD_WARNING;
316 }
317
318 goto done;
319 }
320
321 rc = parse_object(cmd, line, &cid, err);
322 if (rc != MUTT_CMD_SUCCESS)
323 goto done;
324
325 ac = attr_color_new();
326 rc = callback(cmd, line, ac, err);
327 if (rc != MUTT_CMD_SUCCESS)
328 goto done;
329
330 //------------------------------------------------------------------
331 // Business Logic
332
333 rc = MUTT_CMD_ERROR;
334 if ((ac->fg.type == CT_RGB) || (ac->bg.type == CT_RGB))
335 {
336#ifndef NEOMUTT_DIRECT_COLORS
337 buf_printf(err, _("Direct colors support not compiled in: %s"), buf_string(line));
338 goto done;
339#endif
340
341 const bool c_color_directcolor = cs_subset_bool(NeoMutt->sub, "color_directcolor");
342 if (!c_color_directcolor)
343 {
344 buf_printf(err, _("Direct colors support disabled: %s"), buf_string(line));
345 goto done;
346 }
347 }
348
349 if ((ac->fg.color >= COLORS) || (ac->bg.color >= COLORS))
350 {
351 buf_printf(err, _("%s: color not supported by term"), buf_string(line));
352 goto done;
353 }
354
355 //------------------------------------------------------------------
356
357 /* extract a regular expression if needed */
358
359 if (mutt_color_has_pattern(cid) && (cid != MT_COLOR_STATUS))
360 {
361 color_debug(LL_DEBUG5, "regex needed\n");
362 if (MoreArgs(line))
363 {
364 parse_extract_token(token, line, TOKEN_NONE);
365 }
366 else
367 {
368 buf_strcpy(token, ".*");
369 }
370 }
371
372 if (MoreArgs(line) && (cid != MT_COLOR_STATUS))
373 {
374 buf_printf(err, _("%s: too many arguments"), cmd->name);
375 rc = MUTT_CMD_WARNING;
376 goto done;
377 }
378
379 if (regex_colors_parse_color_list(cid, buf_string(token), ac, &rc, err))
380 {
381 color_debug(LL_DEBUG5, "regex_colors_parse_color_list done\n");
382 goto done;
383 // do nothing
384 }
385 else if ((cid == MT_COLOR_STATUS) && MoreArgs(line))
386 {
387 color_debug(LL_DEBUG5, "status\n");
388 /* 'color status fg bg' can have up to 2 arguments:
389 * 0 arguments: sets the default status color (handled below by else part)
390 * 1 argument : colorize pattern on match
391 * 2 arguments: colorize nth submatch of pattern */
392 parse_extract_token(token, line, TOKEN_NONE);
393
394 if (MoreArgs(line))
395 {
396 struct Buffer *tmp = buf_pool_get();
398 if (!mutt_str_atoui_full(buf_string(tmp), &match))
399 {
400 buf_printf(err, _("%s: invalid number: %s"), cmd->name, buf_string(tmp));
401 buf_pool_release(&tmp);
402 rc = MUTT_CMD_WARNING;
403 goto done;
404 }
405 buf_pool_release(&tmp);
406 }
407
408 if (MoreArgs(line))
409 {
410 buf_printf(err, _("%s: too many arguments"), cmd->name);
411 rc = MUTT_CMD_WARNING;
412 goto done;
413 }
414
415 rc = regex_colors_parse_status_list(cid, buf_string(token), ac, match, err);
416 goto done;
417 }
418 else // Remaining simple colours
419 {
420 color_debug(LL_DEBUG5, "simple\n");
421 if (simple_color_set(cid, ac))
422 rc = MUTT_CMD_SUCCESS;
423 else
424 rc = MUTT_CMD_ERROR;
425 }
426
427 if (rc == MUTT_CMD_SUCCESS)
428 {
429 get_colorid_name(cid, token);
430 color_debug(LL_DEBUG5, "NT_COLOR_SET: %s\n", buf_string(token));
432 struct EventColor ev_c = { cid, NULL };
434 }
435
436done:
437 attr_color_free(&ac);
438 buf_pool_release(&token);
439 return rc;
440}
441
448enum CommandResult parse_uncolor(const struct Command *cmd, struct Buffer *line,
449 const struct ParseContext *pc, struct ParseError *pe)
450{
451 struct Buffer *err = pe->message;
452
453 if (!MoreArgs(line))
454 {
455 buf_printf(err, _("%s: too few arguments"), cmd->name);
456 return MUTT_CMD_WARNING;
457 }
458
459 struct Buffer *token = buf_pool_get();
461
462 if (!OptGui) // No GUI, so quietly discard the command
463 {
464 while (MoreArgs(line))
465 {
466 parse_extract_token(token, line, TOKEN_NONE);
467 }
468 goto done;
469 }
470
471 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(token));
472 rc = parse_uncolor_command(cmd, line, pc, pe);
473 curses_colors_dump(token);
474
475done:
476 buf_pool_release(&token);
477 return rc;
478}
479
486enum CommandResult parse_unmono(const struct Command *cmd, struct Buffer *line,
487 const struct ParseContext *pc, struct ParseError *pe)
488{
489 // Quietly discard the command
490 struct Buffer *token = buf_pool_get();
491 while (MoreArgs(line))
492 {
493 parse_extract_token(token, line, TOKEN_NONE);
494 }
495 buf_pool_release(&token);
496
497 return MUTT_CMD_SUCCESS;
498}
499
508enum CommandResult parse_color(const struct Command *cmd, struct Buffer *line,
509 const struct ParseContext *pc, struct ParseError *pe)
510{
511 struct Buffer *err = pe->message;
512
513 struct Buffer *token = buf_pool_get();
515
516 // No GUI, or no colours, so quietly discard the command
517 if (!OptGui || (COLORS == 0))
518 {
519 while (MoreArgs(line))
520 {
521 parse_extract_token(token, line, TOKEN_NONE);
522 }
523 goto done;
524 }
525
526 color_debug(LL_DEBUG5, "parse: color\n");
527 rc = parse_color_command(cmd, line, err, parse_color_pair);
528 curses_colors_dump(token);
529
530done:
531 buf_pool_release(&token);
532 return rc;
533}
534
541enum CommandResult parse_mono(const struct Command *cmd, struct Buffer *line,
542 const struct ParseContext *pc, struct ParseError *pe)
543{
544 struct Buffer *err = pe->message;
545
546 struct Buffer *token = buf_pool_get();
548
549 // No GUI, or colours available, so quietly discard the command
550 if (!OptGui || (COLORS != 0))
551 {
552 while (MoreArgs(line))
553 {
554 parse_extract_token(token, line, TOKEN_NONE);
555 }
556 goto done;
557 }
558
559 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(token));
560 rc = parse_color_command(cmd, line, err, parse_attr_spec);
561 curses_colors_dump(token);
562
563done:
564 buf_pool_release(&token);
565 return rc;
566}
567
571const struct Command ColorCommands[] = {
572 // clang-format off
573 { "color", CMD_COLOR, parse_color,
574 N_("Define colors for the user interface"),
575 N_("color <object> [ <attribute> ... ] <fg> <bg> [ <regex> [ <num> ]]"),
576 "configuration.html#color" },
577 { "mono", CMD_MONO, parse_mono,
578 N_("Deprecated: Use `color` instead"),
579 N_("mono <object> <attribute> [ <pattern> | <regex> ]"),
580 "configuration.html#color-mono" },
581 { "uncolor", CMD_UNCOLOR, parse_uncolor,
582 N_("Remove a `color` definition"),
583 N_("uncolor <object> { * | <pattern> ... }"),
584 "configuration.html#color" },
585 { "unmono", CMD_UNMONO, parse_unmono,
586 N_("Deprecated: Use `uncolor` instead"),
587 N_("unmono <object> { * | <pattern> ... }"),
588 "configuration.html#color-mono" },
589
590 { NULL, CMD_NONE, NULL, NULL, NULL, NULL, CF_NONE },
591 // clang-format on
592};
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:168
int buf_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
Definition buffer.c:211
void buf_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
Definition buffer.c:189
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition buffer.c:233
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:401
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:571
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:292
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:387
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:325
bool regex_colors_parse_uncolor(enum ColorId cid, const char *pat)
Parse a Regex 'uncolor' command.
Definition regex.c:415
struct AttrColor * simple_color_set(enum ColorId cid, struct AttrColor *ac_val)
Set the colour of a simple object.
Definition simple.c:131
void simple_color_reset(enum ColorId cid)
Clear the colour of a simple object.
Definition simple.c:155
bool mutt_color_has_pattern(enum ColorId cid)
Check if a color object supports a regex pattern.
Definition color.c:102
void colors_reset(struct ColorModuleData *mod_data)
Reset all the simple, quoted and regex colours.
Definition color.c:71
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
@ CF_NONE
No flags are set.
Definition command.h:49
@ CMD_UNCOLOR
:uncolor
Definition command.h:132
@ CMD_COLOR
:color
Definition command.h:74
@ CMD_NONE
No Command.
Definition command.h:62
@ CMD_MONO
:mono
Definition command.h:99
@ CMD_UNMONO
:unmono
Definition command.h:142
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:35
#define MoreArgs(buf)
Definition extract.h:32
@ TOKEN_COMMENT
Don't reap comments.
Definition extract.h:56
@ TOKEN_NONE
No flags are set.
Definition extract.h:50
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:448
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:486
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:541
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:508
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:666
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:162
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