NeoMutt  2025-01-09-81-g753ae0
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
command.c
Go to the documentation of this file.
1
31#include "config.h"
32#include <stdbool.h>
33#include <stddef.h>
34#include <stdint.h>
35#include "mutt/lib.h"
36#include "config/lib.h"
37#include "core/lib.h"
38#include "gui/lib.h"
39#include "mutt.h"
40#include "parse/lib.h"
41#include "attr.h"
42#include "color.h"
43#include "command2.h"
44#include "debug.h"
45#include "dump.h"
46#include "globals.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_SPOOLFILE },
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_SPOOLFILE },
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(struct Buffer *buf, struct Buffer *s,
148 enum ColorId *cid, struct Buffer *err)
149{
150 if (mutt_istr_equal(buf->data, "compose"))
151 {
152 if (!MoreArgs(s))
153 {
154 buf_printf(err, _("%s: too few arguments"), "color");
155 return MUTT_CMD_WARNING;
156 }
157
158 struct Buffer *tmp = buf_pool_get();
160 buf_fix_dptr(buf);
161 buf_add_printf(buf, "_%s", buf_string(tmp));
162 buf_pool_release(&tmp);
163 }
164
165 int rc = mutt_map_get_value(buf->data, ColorFields);
166 if (rc == -1)
167 {
168 buf_printf(err, _("%s: no such object"), buf->data);
169 return MUTT_CMD_WARNING;
170 }
171 else
172 {
173 color_debug(LL_DEBUG5, "object: %s\n", mutt_map_get_name(rc, ColorFields));
174 }
175
176 *cid = rc;
177 return MUTT_CMD_SUCCESS;
178}
179
192static enum CommandResult parse_uncolor(struct Buffer *buf, struct Buffer *s,
193 struct Buffer *err, bool uncolor)
194{
195 if (OptNoCurses) // No GUI, so quietly discard the command
196 {
197 while (MoreArgs(s))
198 {
200 }
201 return MUTT_CMD_SUCCESS;
202 }
203
205
206 if (mutt_str_equal(buf->data, "*"))
207 {
208 colors_reset();
209 return MUTT_CMD_SUCCESS;
210 }
211
212 unsigned int cid = MT_COLOR_NONE;
213 color_debug(LL_DEBUG5, "uncolor: %s\n", buf_string(buf));
214 enum CommandResult rc = parse_object(buf, s, &cid, err);
215 if (rc != MUTT_CMD_SUCCESS)
216 return rc;
217
218 if (cid == -1)
219 {
220 buf_printf(err, _("%s: no such object"), buf->data);
221 return MUTT_CMD_ERROR;
222 }
223
224 if ((cid == MT_COLOR_STATUS) && !MoreArgs(s))
225 {
226 color_debug(LL_DEBUG5, "simple\n");
227 simple_color_reset(cid); // default colour for the status bar
228 return MUTT_CMD_SUCCESS;
229 }
230
231 if (!mutt_color_has_pattern(cid))
232 {
233 color_debug(LL_DEBUG5, "simple\n");
235 return MUTT_CMD_SUCCESS;
236 }
237
238 if (!MoreArgs(s))
239 {
240 if (regex_colors_parse_uncolor(cid, NULL, uncolor))
241 return MUTT_CMD_SUCCESS;
242 else
243 return MUTT_CMD_ERROR;
244 }
245
246 do
247 {
249 if (mutt_str_equal("*", buf->data))
250 {
251 if (regex_colors_parse_uncolor(cid, NULL, uncolor))
252 return MUTT_CMD_SUCCESS;
253 else
254 return MUTT_CMD_ERROR;
255 }
256
257 regex_colors_parse_uncolor(cid, buf->data, uncolor);
258
259 } while (MoreArgs(s));
260
261 return MUTT_CMD_SUCCESS;
262}
263
277static enum CommandResult parse_color(struct Buffer *buf, struct Buffer *s,
278 struct Buffer *err,
279 parser_callback_t callback, bool color)
280{
281 unsigned int match = 0;
282 enum ColorId cid = MT_COLOR_NONE;
284 struct AttrColor *ac = NULL;
285
286 if (!MoreArgs(s))
287 {
288 if (StartupComplete)
289 {
290 color_dump();
291 rc = MUTT_CMD_SUCCESS;
292 }
293 else
294 {
295 buf_printf(err, _("%s: too few arguments"), color ? "color" : "mono");
296 rc = MUTT_CMD_WARNING;
297 }
298
299 goto done;
300 }
301
303 color_debug(LL_DEBUG5, "color: %s\n", buf_string(buf));
304
305 rc = parse_object(buf, s, &cid, err);
306 if (rc != MUTT_CMD_SUCCESS)
307 goto done;
308
309 ac = attr_color_new();
310 rc = callback(buf, s, ac, err);
311 if (rc != MUTT_CMD_SUCCESS)
312 goto done;
313
314 //------------------------------------------------------------------
315 // Business Logic
316
317 if ((ac->fg.type == CT_RGB) || (ac->bg.type == CT_RGB))
318 {
319#ifndef NEOMUTT_DIRECT_COLORS
320 buf_printf(err, _("Direct colors support not compiled in: %s"), buf_string(s));
321 return MUTT_CMD_ERROR;
322#endif
323
324 const bool c_color_directcolor = cs_subset_bool(NeoMutt->sub, "color_directcolor");
325 if (!c_color_directcolor)
326 {
327 buf_printf(err, _("Direct colors support disabled: %s"), buf_string(s));
328 return MUTT_CMD_ERROR;
329 }
330 }
331
332 if ((ac->fg.color >= COLORS) || (ac->bg.color >= COLORS))
333 {
334 buf_printf(err, _("%s: color not supported by term"), buf_string(s));
335 return MUTT_CMD_ERROR;
336 }
337
338 //------------------------------------------------------------------
339
340 /* extract a regular expression if needed */
341
342 if (mutt_color_has_pattern(cid) && (cid != MT_COLOR_STATUS))
343 {
344 color_debug(LL_DEBUG5, "regex needed\n");
345 if (MoreArgs(s))
346 {
348 }
349 else
350 {
351 buf_strcpy(buf, ".*");
352 }
353 }
354
355 if (MoreArgs(s) && (cid != MT_COLOR_STATUS))
356 {
357 buf_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
358 rc = MUTT_CMD_WARNING;
359 goto done;
360 }
361
362 if (regex_colors_parse_color_list(cid, buf->data, ac, &rc, err))
363 {
364 color_debug(LL_DEBUG5, "regex_colors_parse_color_list done\n");
365 goto done;
366 // do nothing
367 }
368 else if ((cid == MT_COLOR_STATUS) && MoreArgs(s))
369 {
370 color_debug(LL_DEBUG5, "status\n");
371 /* 'color status fg bg' can have up to 2 arguments:
372 * 0 arguments: sets the default status color (handled below by else part)
373 * 1 argument : colorize pattern on match
374 * 2 arguments: colorize nth submatch of pattern */
376
377 if (MoreArgs(s))
378 {
379 struct Buffer *tmp = buf_pool_get();
381 if (!mutt_str_atoui_full(tmp->data, &match))
382 {
383 buf_printf(err, _("%s: invalid number: %s"), color ? "color" : "mono", tmp->data);
384 buf_pool_release(&tmp);
385 rc = MUTT_CMD_WARNING;
386 goto done;
387 }
388 buf_pool_release(&tmp);
389 }
390
391 if (MoreArgs(s))
392 {
393 buf_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
394 rc = MUTT_CMD_WARNING;
395 goto done;
396 }
397
398 rc = regex_colors_parse_status_list(cid, buf->data, ac, match, err);
399 goto done;
400 }
401 else // Remaining simple colours
402 {
403 color_debug(LL_DEBUG5, "simple\n");
404 if (simple_color_set(cid, ac))
405 rc = MUTT_CMD_SUCCESS;
406 else
407 rc = MUTT_CMD_ERROR;
408 }
409
410 if (rc == MUTT_CMD_SUCCESS)
411 {
412 get_colorid_name(cid, buf);
413 color_debug(LL_DEBUG5, "NT_COLOR_SET: %s\n", buf->data);
414 struct EventColor ev_c = { cid, NULL };
416 }
417
418done:
419 attr_color_free(&ac);
420 return rc;
421}
422
426enum CommandResult mutt_parse_uncolor(struct Buffer *buf, struct Buffer *s,
427 intptr_t data, struct Buffer *err)
428{
429 if (OptNoCurses) // No GUI, so quietly discard the command
430 {
431 while (MoreArgs(s))
432 {
434 }
435 return MUTT_CMD_SUCCESS;
436 }
437
438 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(buf));
439 enum CommandResult rc = parse_uncolor(buf, s, err, true);
441 return rc;
442}
443
447enum CommandResult mutt_parse_unmono(struct Buffer *buf, struct Buffer *s,
448 intptr_t data, struct Buffer *err)
449{
450 *s->dptr = '\0'; /* fake that we're done parsing */
451 return MUTT_CMD_SUCCESS;
452}
453
457enum CommandResult mutt_parse_color(struct Buffer *buf, struct Buffer *s,
458 intptr_t data, struct Buffer *err)
459{
460 // No GUI, or no colours, so quietly discard the command
461 if (OptNoCurses || (COLORS == 0))
462 {
463 while (MoreArgs(s))
464 {
466 }
467 return MUTT_CMD_SUCCESS;
468 }
469
470 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(buf));
471 enum CommandResult rc = parse_color(buf, s, err, parse_color_pair, true);
473 return rc;
474}
475
479enum CommandResult mutt_parse_mono(struct Buffer *buf, struct Buffer *s,
480 intptr_t data, struct Buffer *err)
481{
482 // No GUI, or colours available, so quietly discard the command
483 if (OptNoCurses || (COLORS != 0))
484 {
485 while (MoreArgs(s))
486 {
488 }
489 return MUTT_CMD_SUCCESS;
490 }
491
492 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(buf));
493 enum CommandResult rc = parse_color(buf, s, err, parse_attr_spec, false);
495 return rc;
496}
struct AttrColor * attr_color_new(void)
Create a new AttrColor.
Definition: attr.c:90
void attr_color_free(struct AttrColor **ptr)
Free an AttrColor.
Definition: attr.c:69
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: command.c:128
const struct Mapping ColorFields[]
Mapping of colour names to their IDs.
Definition: command.c:55
static enum CommandResult parse_color(struct Buffer *buf, struct Buffer *s, struct Buffer *err, parser_callback_t callback, bool color)
Parse a 'color' command.
Definition: command.c:277
static enum CommandResult parse_object(struct Buffer *buf, struct Buffer *s, enum ColorId *cid, struct Buffer *err)
Identify a colour object.
Definition: command.c:147
static enum CommandResult parse_uncolor(struct Buffer *buf, struct Buffer *s, struct Buffer *err, bool uncolor)
Parse an 'uncolor' command.
Definition: command.c:192
void color_dump(void)
Display all the colours in the Pager.
Definition: dump.c:450
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:383
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:322
bool regex_colors_parse_uncolor(enum ColorId cid, const char *pat, bool uncolor)
Parse a Regex 'uncolor' command.
Definition: regex.c:411
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.
ColorId
List of all coloured objects.
Definition: color.h:36
@ MT_COLOR_SIDEBAR_DIVIDER
Line dividing sidebar from the index/pager.
Definition: color.h:71
@ 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:89
@ MT_COLOR_QUOTED0
Pager: quoted text, level 0.
Definition: color.h:59
@ MT_COLOR_SIDEBAR_NEW
Mailbox with new mail.
Definition: color.h:75
@ MT_COLOR_HEADER
Message headers (takes a pattern)
Definition: color.h:49
@ MT_COLOR_STATUS
Status bar (takes a pattern)
Definition: color.h:80
@ MT_COLOR_SIDEBAR_UNREAD
Mailbox with unread mail.
Definition: color.h:78
@ MT_COLOR_INDEX_SIZE
Index: size field.
Definition: color.h:95
@ 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:81
@ MT_COLOR_SIDEBAR_SPOOLFILE
$spool_file (Spool mailbox)
Definition: color.h:77
@ 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:76
@ MT_COLOR_QUOTED1
Pager: quoted text, level 1.
Definition: color.h:60
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
Definition: color.h:98
@ MT_COLOR_QUOTED3
Pager: quoted text, level 3.
Definition: color.h:62
@ MT_COLOR_BOLD
Bold text.
Definition: color.h:41
@ MT_COLOR_INDEX_SUBJECT
Index: subject field.
Definition: color.h:96
@ 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:91
@ MT_COLOR_QUOTED6
Pager: quoted text, level 6.
Definition: color.h:65
@ MT_COLOR_PROGRESS
Progress bar.
Definition: color.h:57
@ 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:67
@ MT_COLOR_SIDEBAR_BACKGROUND
Background colour for the Sidebar.
Definition: color.h:70
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
Definition: color.h:97
@ MT_COLOR_HDRDEFAULT
Header default colour.
Definition: color.h:48
@ MT_COLOR_OPTIONS
Options in prompt.
Definition: color.h:56
@ MT_COLOR_TREE
Index: tree-drawing characters.
Definition: color.h:84
@ MT_COLOR_QUOTED7
Pager: quoted text, level 7.
Definition: color.h:66
@ MT_COLOR_NORMAL
Plain text.
Definition: color.h:55
@ MT_COLOR_ATTACH_HEADERS
MIME attachment test (takes a pattern)
Definition: color.h:39
@ MT_COLOR_SEARCH
Pager: search matches.
Definition: color.h:69
@ MT_COLOR_COMPOSE_SECURITY_SIGN
Mail will be signed.
Definition: color.h:46
@ MT_COLOR_INDEX_LABEL
Index: label field.
Definition: color.h:93
@ MT_COLOR_ITALIC
Italic text.
Definition: color.h:51
@ MT_COLOR_QUOTED4
Pager: quoted text, level 4.
Definition: color.h:63
@ MT_COLOR_STRIPE_ODD
Stripes: odd lines of the Help Page.
Definition: color.h:82
@ MT_COLOR_PROMPT
Question/user input.
Definition: color.h:58
@ MT_COLOR_COMPOSE_HEADER
Header labels, e.g. From:
Definition: color.h:42
@ MT_COLOR_INDEX
Index: default colour.
Definition: color.h:88
@ MT_COLOR_QUOTED9
Pager: quoted text, level 9.
Definition: color.h:68
@ MT_COLOR_QUOTED2
Pager: quoted text, level 2.
Definition: color.h:61
@ MT_COLOR_ATTACHMENT
MIME attachments text (entire line)
Definition: color.h:38
@ MT_COLOR_SIDEBAR_INDICATOR
Current open mailbox.
Definition: color.h:74
@ MT_COLOR_SIDEBAR_HIGHLIGHT
Select cursor.
Definition: color.h:73
@ MT_COLOR_WARNING
Warning messages.
Definition: color.h:86
@ MT_COLOR_UNDERLINE
Underlined text.
Definition: color.h:85
@ MT_COLOR_INDEX_NUMBER
Index: index number.
Definition: color.h:94
@ MT_COLOR_SIGNATURE
Pager: signature lines.
Definition: color.h:79
@ MT_COLOR_INDEX_FLAGS
Index: flags field.
Definition: color.h:92
@ MT_COLOR_QUOTED5
Pager: quoted text, level 5.
Definition: color.h:64
@ MT_COLOR_SIDEBAR_FLAGGED
Mailbox with flagged messages.
Definition: color.h:72
@ MT_COLOR_TILDE
Pager: empty lines after message.
Definition: color.h:83
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
Definition: color.h:90
Parse colour commands.
enum CommandResult(* parser_callback_t)(struct Buffer *buf, struct Buffer *s, struct AttrColor *ac, struct Buffer *err)
Definition: command2.h:45
CommandResult
Error codes for command_t parse functions.
Definition: command.h:36
@ MUTT_CMD_SUCCESS
Success: Command worked.
Definition: command.h:39
@ MUTT_CMD_ERROR
Error: Can't help the user.
Definition: command.h:37
@ MUTT_CMD_WARNING
Warning: Help given to the user.
Definition: command.h:38
Dump all the config.
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: main.c:198
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 *tok, TokenFlags flags)
Extract one token from a string.
Definition: extract.c:50
#define MoreArgs(buf)
Definition: extract.h:32
#define TOKEN_NO_FLAGS
No flags are set.
Definition: extract.h:46
bool OptNoCurses
(pseudo) when sending in batch mode
Definition: globals.c:69
enum CommandResult mutt_parse_unmono(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'unmono' command - Implements Command::parse() -.
Definition: command.c:447
enum CommandResult mutt_parse_mono(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'mono' command - Implements Command::parse() -.
Definition: command.c:479
enum CommandResult mutt_parse_color(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'color' command - Implements Command::parse() -.
Definition: command.c:457
enum CommandResult mutt_parse_uncolor(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'uncolor' command - Implements Command::parse() -.
Definition: command.c:426
enum CommandResult parse_attr_spec(struct Buffer *buf, struct Buffer *s, struct AttrColor *ac, struct Buffer *err)
Parse an attribute description - Implements parser_callback_t -.
Definition: parse_color.c:325
enum CommandResult parse_color_pair(struct Buffer *buf, struct Buffer *s, struct AttrColor *ac, struct Buffer *err)
Parse a pair of colours - Implements parser_callback_t -.
Definition: parse_color.c:281
Convenience wrapper for the gui headers.
@ LL_DEBUG5
Log at debug level 5.
Definition: logging2.h:47
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:673
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:661
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
char * data
Pointer to data.
Definition: buffer.h:37
enum ColorType type
Type of Colour.
Definition: attr.h:58
color_t color
Colour.
Definition: attr.h:57
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:42
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46