NeoMutt  2025-09-05-29-ga12b18
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_string(buf), "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
166 if (rc == -1)
167 {
168 buf_printf(err, _("%s: no such object"), buf_string(buf));
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
190static enum CommandResult parse_uncolor_command(struct Buffer *buf, struct Buffer *s,
191 struct Buffer *err)
192{
193 if (!MoreArgs(s))
194 {
195 buf_printf(err, _("%s: too few arguments"), "uncolor");
196 return MUTT_CMD_WARNING;
197 }
198
200
201 if (mutt_str_equal(buf_string(buf), "*"))
202 {
203 colors_reset();
204 return MUTT_CMD_SUCCESS;
205 }
206
207 unsigned int cid = MT_COLOR_NONE;
208 color_debug(LL_DEBUG5, "uncolor: %s\n", buf_string(buf));
209 enum CommandResult rc = parse_object(buf, s, &cid, err);
210 if (rc != MUTT_CMD_SUCCESS)
211 return rc;
212
213 if (cid == -1)
214 {
215 buf_printf(err, _("%s: no such object"), buf_string(buf));
216 return MUTT_CMD_ERROR;
217 }
218
219 if ((cid == MT_COLOR_STATUS) && !MoreArgs(s))
220 {
221 color_debug(LL_DEBUG5, "simple\n");
222 simple_color_reset(cid); // default colour for the status bar
223 return MUTT_CMD_SUCCESS;
224 }
225
226 if (!mutt_color_has_pattern(cid))
227 {
228 color_debug(LL_DEBUG5, "simple\n");
230 return MUTT_CMD_SUCCESS;
231 }
232
233 if (!MoreArgs(s))
234 {
235 if (regex_colors_parse_uncolor(cid, NULL))
236 return MUTT_CMD_SUCCESS;
237 else
238 return MUTT_CMD_ERROR;
239 }
240
241 do
242 {
244 if (mutt_str_equal("*", buf_string(buf)))
245 {
246 if (regex_colors_parse_uncolor(cid, NULL))
247 return MUTT_CMD_SUCCESS;
248 else
249 return MUTT_CMD_ERROR;
250 }
251
253
254 } while (MoreArgs(s));
255
256 return MUTT_CMD_SUCCESS;
257}
258
273 struct Buffer *s, struct Buffer *err,
274 parser_callback_t callback, bool color)
275{
276 unsigned int match = 0;
277 enum ColorId cid = MT_COLOR_NONE;
279 struct AttrColor *ac = NULL;
280
281 if (!MoreArgs(s))
282 {
283 if (StartupComplete)
284 {
285 color_dump();
286 rc = MUTT_CMD_SUCCESS;
287 }
288 else
289 {
290 buf_printf(err, _("%s: too few arguments"), color ? "color" : "mono");
291 rc = MUTT_CMD_WARNING;
292 }
293
294 goto done;
295 }
296
298 color_debug(LL_DEBUG5, "color: %s\n", buf_string(buf));
299
300 rc = parse_object(buf, s, &cid, err);
301 if (rc != MUTT_CMD_SUCCESS)
302 goto done;
303
304 ac = attr_color_new();
305 rc = callback(buf, s, ac, err);
306 if (rc != MUTT_CMD_SUCCESS)
307 goto done;
308
309 //------------------------------------------------------------------
310 // Business Logic
311
312 if ((ac->fg.type == CT_RGB) || (ac->bg.type == CT_RGB))
313 {
314#ifndef NEOMUTT_DIRECT_COLORS
315 buf_printf(err, _("Direct colors support not compiled in: %s"), buf_string(s));
316 return MUTT_CMD_ERROR;
317#endif
318
319 const bool c_color_directcolor = cs_subset_bool(NeoMutt->sub, "color_directcolor");
320 if (!c_color_directcolor)
321 {
322 buf_printf(err, _("Direct colors support disabled: %s"), buf_string(s));
323 return MUTT_CMD_ERROR;
324 }
325 }
326
327 if ((ac->fg.color >= COLORS) || (ac->bg.color >= COLORS))
328 {
329 buf_printf(err, _("%s: color not supported by term"), buf_string(s));
330 return MUTT_CMD_ERROR;
331 }
332
333 //------------------------------------------------------------------
334
335 /* extract a regular expression if needed */
336
337 if (mutt_color_has_pattern(cid) && (cid != MT_COLOR_STATUS))
338 {
339 color_debug(LL_DEBUG5, "regex needed\n");
340 if (MoreArgs(s))
341 {
343 }
344 else
345 {
346 buf_strcpy(buf, ".*");
347 }
348 }
349
350 if (MoreArgs(s) && (cid != MT_COLOR_STATUS))
351 {
352 buf_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
353 rc = MUTT_CMD_WARNING;
354 goto done;
355 }
356
357 if (regex_colors_parse_color_list(cid, buf_string(buf), ac, &rc, err))
358 {
359 color_debug(LL_DEBUG5, "regex_colors_parse_color_list done\n");
360 goto done;
361 // do nothing
362 }
363 else if ((cid == MT_COLOR_STATUS) && MoreArgs(s))
364 {
365 color_debug(LL_DEBUG5, "status\n");
366 /* 'color status fg bg' can have up to 2 arguments:
367 * 0 arguments: sets the default status color (handled below by else part)
368 * 1 argument : colorize pattern on match
369 * 2 arguments: colorize nth submatch of pattern */
371
372 if (MoreArgs(s))
373 {
374 struct Buffer *tmp = buf_pool_get();
376 if (!mutt_str_atoui_full(buf_string(tmp), &match))
377 {
378 buf_printf(err, _("%s: invalid number: %s"), color ? "color" : "mono",
379 buf_string(tmp));
380 buf_pool_release(&tmp);
381 rc = MUTT_CMD_WARNING;
382 goto done;
383 }
384 buf_pool_release(&tmp);
385 }
386
387 if (MoreArgs(s))
388 {
389 buf_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
390 rc = MUTT_CMD_WARNING;
391 goto done;
392 }
393
394 rc = regex_colors_parse_status_list(cid, buf_string(buf), ac, match, err);
395 goto done;
396 }
397 else // Remaining simple colours
398 {
399 color_debug(LL_DEBUG5, "simple\n");
400 if (simple_color_set(cid, ac))
401 rc = MUTT_CMD_SUCCESS;
402 else
403 rc = MUTT_CMD_ERROR;
404 }
405
406 if (rc == MUTT_CMD_SUCCESS)
407 {
408 get_colorid_name(cid, buf);
409 color_debug(LL_DEBUG5, "NT_COLOR_SET: %s\n", buf_string(buf));
410 struct EventColor ev_c = { cid, NULL };
412 }
413
414done:
415 attr_color_free(&ac);
416 return rc;
417}
418
422enum CommandResult parse_uncolor(struct Buffer *buf, struct Buffer *s,
423 intptr_t data, struct Buffer *err)
424{
425 if (!OptGui) // No GUI, so quietly discard the command
426 {
427 while (MoreArgs(s))
428 {
430 }
431 return MUTT_CMD_SUCCESS;
432 }
433
434 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(buf));
435 enum CommandResult rc = parse_uncolor_command(buf, s, err);
437 return rc;
438}
439
443enum CommandResult parse_unmono(struct Buffer *buf, struct Buffer *s,
444 intptr_t data, struct Buffer *err)
445{
446 *s->dptr = '\0'; /* fake that we're done parsing */
447 return MUTT_CMD_SUCCESS;
448}
449
453enum CommandResult parse_color(struct Buffer *buf, struct Buffer *s,
454 intptr_t data, struct Buffer *err)
455{
456 // No GUI, or no colours, so quietly discard the command
457 if (!OptGui || (COLORS == 0))
458 {
459 while (MoreArgs(s))
460 {
462 }
463 return MUTT_CMD_SUCCESS;
464 }
465
466 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(buf));
467 enum CommandResult rc = parse_color_command(buf, s, err, parse_color_pair, true);
469 return rc;
470}
471
475enum CommandResult parse_mono(struct Buffer *buf, struct Buffer *s,
476 intptr_t data, struct Buffer *err)
477{
478 // No GUI, or colours available, so quietly discard the command
479 if (!OptGui || (COLORS != 0))
480 {
481 while (MoreArgs(s))
482 {
484 }
485 return MUTT_CMD_SUCCESS;
486 }
487
488 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(buf));
489 enum CommandResult rc = parse_color_command(buf, s, err, parse_attr_spec, false);
491 return rc;
492}
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
static enum CommandResult parse_uncolor_command(struct Buffer *buf, struct Buffer *s, struct Buffer *err)
Parse an 'uncolor' command.
Definition: command.c:190
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_command(struct Buffer *buf, struct Buffer *s, struct Buffer *err, parser_callback_t callback, bool color)
Parse a 'color' command.
Definition: command.c:272
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
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:398
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:337
bool regex_colors_parse_uncolor(enum ColorId cid, const char *pat)
Parse a Regex 'uncolor' command.
Definition: regex.c:425
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: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
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: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
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: 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 *tok, TokenFlags flags)
Extract one token from a string.
Definition: extract.c:48
#define MoreArgs(buf)
Definition: extract.h:30
#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_uncolor(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'uncolor' command - Implements Command::parse() -.
Definition: command.c:422
enum CommandResult parse_unmono(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'unmono' command - Implements Command::parse() -.
Definition: command.c:443
enum CommandResult parse_mono(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'mono' command - Implements Command::parse() -.
Definition: command.c:475
enum CommandResult parse_color(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'color' command - Implements Command::parse() -.
Definition: command.c:453
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: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
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