NeoMutt  2024-10-02-37-gfa9146
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 "quoted.h"
50#include "regex4.h"
51#include "simple2.h"
52
56const struct Mapping ColorFields[] = {
57 // clang-format off
58 { "attachment", MT_COLOR_ATTACHMENT },
59 { "attach_headers", MT_COLOR_ATTACH_HEADERS },
60 { "body", MT_COLOR_BODY },
61 { "bold", MT_COLOR_BOLD },
62 { "error", MT_COLOR_ERROR },
63 { "hdrdefault", MT_COLOR_HDRDEFAULT },
64 { "header", MT_COLOR_HEADER },
65 { "index", MT_COLOR_INDEX },
66 { "index_author", MT_COLOR_INDEX_AUTHOR },
67 { "index_collapsed", MT_COLOR_INDEX_COLLAPSED },
68 { "index_date", MT_COLOR_INDEX_DATE },
69 { "index_flags", MT_COLOR_INDEX_FLAGS },
70 { "index_label", MT_COLOR_INDEX_LABEL },
71 { "index_number", MT_COLOR_INDEX_NUMBER },
72 { "index_size", MT_COLOR_INDEX_SIZE },
73 { "index_subject", MT_COLOR_INDEX_SUBJECT },
74 { "index_tag", MT_COLOR_INDEX_TAG },
75 { "index_tags", MT_COLOR_INDEX_TAGS },
76 { "indicator", MT_COLOR_INDICATOR },
77 { "italic", MT_COLOR_ITALIC },
78 { "markers", MT_COLOR_MARKERS },
79 { "message", MT_COLOR_MESSAGE },
80 { "normal", MT_COLOR_NORMAL },
81 { "options", MT_COLOR_OPTIONS },
82 { "progress", MT_COLOR_PROGRESS },
83 { "prompt", MT_COLOR_PROMPT },
84 { "quoted", MT_COLOR_QUOTED },
85 { "search", MT_COLOR_SEARCH },
86 { "sidebar_background", MT_COLOR_SIDEBAR_BACKGROUND },
87 { "sidebar_divider", MT_COLOR_SIDEBAR_DIVIDER },
88 { "sidebar_flagged", MT_COLOR_SIDEBAR_FLAGGED },
89 { "sidebar_highlight", MT_COLOR_SIDEBAR_HIGHLIGHT },
90 { "sidebar_indicator", MT_COLOR_SIDEBAR_INDICATOR },
91 { "sidebar_new", MT_COLOR_SIDEBAR_NEW },
92 { "sidebar_ordinary", MT_COLOR_SIDEBAR_ORDINARY },
93 { "sidebar_spool_file", MT_COLOR_SIDEBAR_SPOOLFILE },
94 { "sidebar_spoolfile", MT_COLOR_SIDEBAR_SPOOLFILE }, // This will be deprecated
95 { "sidebar_unread", MT_COLOR_SIDEBAR_UNREAD },
96 { "signature", MT_COLOR_SIGNATURE },
97 { "status", MT_COLOR_STATUS },
98 { "stripe_even", MT_COLOR_STRIPE_EVEN},
99 { "stripe_odd", MT_COLOR_STRIPE_ODD},
100 { "tilde", MT_COLOR_TILDE },
101 { "tree", MT_COLOR_TREE },
102 { "underline", MT_COLOR_UNDERLINE },
103 { "warning", MT_COLOR_WARNING },
104 { NULL, 0 },
105 // clang-format on
106};
107
111const struct Mapping ComposeColorFields[] = {
112 // clang-format off
113 { "header", MT_COLOR_COMPOSE_HEADER },
114 { "security_encrypt", MT_COLOR_COMPOSE_SECURITY_ENCRYPT },
115 { "security_sign", MT_COLOR_COMPOSE_SECURITY_SIGN },
116 { "security_both", MT_COLOR_COMPOSE_SECURITY_BOTH },
117 { "security_none", MT_COLOR_COMPOSE_SECURITY_NONE },
118 { NULL, 0 }
119 // clang-format on
120};
121
127void get_colorid_name(unsigned int cid, struct Buffer *buf)
128{
129 const char *name = NULL;
130
132 {
134 if (name)
135 {
136 buf_printf(buf, "compose %s", name);
137 return;
138 }
139 }
140
142 if (name)
143 buf_addstr(buf, name);
144 else
145 buf_printf(buf, "UNKNOWN %d", cid);
146}
147
159static enum CommandResult parse_object(struct Buffer *buf, struct Buffer *s,
160 enum ColorId *cid, int *ql, struct Buffer *err)
161{
162 int rc;
163
164 if (mutt_str_startswith(buf->data, "quoted") != 0)
165 {
166 int val = 0;
167 if (buf->data[6] != '\0')
168 {
169 if (!mutt_str_atoi_full(buf->data + 6, &val) || (val > COLOR_QUOTES_MAX))
170 {
171 buf_printf(err, _("%s: no such object"), buf->data);
172 return MUTT_CMD_WARNING;
173 }
174 }
175
176 *ql = val;
177 *cid = MT_COLOR_QUOTED;
178 return MUTT_CMD_SUCCESS;
179 }
180
181 if (mutt_istr_equal(buf->data, "compose"))
182 {
183 if (!MoreArgs(s))
184 {
185 buf_printf(err, _("%s: too few arguments"), "color");
186 return MUTT_CMD_WARNING;
187 }
188
190
192 if (rc == -1)
193 {
194 buf_printf(err, _("%s: no such object"), buf->data);
195 return MUTT_CMD_WARNING;
196 }
197
198 *cid = rc;
199 return MUTT_CMD_SUCCESS;
200 }
201
203 if (rc == -1)
204 {
205 buf_printf(err, _("%s: no such object"), buf->data);
206 return MUTT_CMD_WARNING;
207 }
208 else
209 {
210 color_debug(LL_DEBUG5, "object: %s\n", mutt_map_get_name(rc, ColorFields));
211 }
212
213 *cid = rc;
214 return MUTT_CMD_SUCCESS;
215}
216
229static enum CommandResult parse_uncolor(struct Buffer *buf, struct Buffer *s,
230 struct Buffer *err, bool uncolor)
231{
232 if (OptNoCurses) // No GUI, so quietly discard the command
233 {
234 while (MoreArgs(s))
235 {
237 }
238 return MUTT_CMD_SUCCESS;
239 }
240
242
243 if (mutt_str_equal(buf->data, "*"))
244 {
246 return MUTT_CMD_SUCCESS;
247 }
248
249 unsigned int cid = MT_COLOR_NONE;
250 int ql = 0;
251 color_debug(LL_DEBUG5, "uncolor: %s\n", buf_string(buf));
252 enum CommandResult rc = parse_object(buf, s, &cid, &ql, err);
253 if (rc != MUTT_CMD_SUCCESS)
254 return rc;
255
256 if (cid == -1)
257 {
258 buf_printf(err, _("%s: no such object"), buf->data);
259 return MUTT_CMD_ERROR;
260 }
261
262 if (cid == MT_COLOR_QUOTED)
263 {
264 color_debug(LL_DEBUG5, "quoted\n");
265 return quoted_colors_parse_uncolor(cid, ql, err);
266 }
267
268 if ((cid == MT_COLOR_STATUS) && !MoreArgs(s))
269 {
270 color_debug(LL_DEBUG5, "simple\n");
271 simple_color_reset(cid); // default colour for the status bar
272 return MUTT_CMD_SUCCESS;
273 }
274
275 if (!mutt_color_has_pattern(cid))
276 {
277 color_debug(LL_DEBUG5, "simple\n");
279 return MUTT_CMD_SUCCESS;
280 }
281
282 if (!MoreArgs(s))
283 {
284 if (regex_colors_parse_uncolor(cid, NULL, uncolor))
285 return MUTT_CMD_SUCCESS;
286 else
287 return MUTT_CMD_ERROR;
288 }
289
290 do
291 {
293 if (mutt_str_equal("*", buf->data))
294 {
295 if (regex_colors_parse_uncolor(cid, NULL, uncolor))
296 return MUTT_CMD_SUCCESS;
297 else
298 return MUTT_CMD_ERROR;
299 }
300
301 regex_colors_parse_uncolor(cid, buf->data, uncolor);
302
303 } while (MoreArgs(s));
304
305 return MUTT_CMD_SUCCESS;
306}
307
321static enum CommandResult parse_color(struct Buffer *buf, struct Buffer *s,
322 struct Buffer *err,
323 parser_callback_t callback, bool color)
324{
325 int q_level = 0;
326 unsigned int match = 0;
327 enum ColorId cid = MT_COLOR_NONE;
329 struct AttrColor *ac = NULL;
330
331 if (!MoreArgs(s))
332 {
333 if (StartupComplete)
334 {
335 color_dump();
336 rc = MUTT_CMD_SUCCESS;
337 }
338 else
339 {
340 buf_printf(err, _("%s: too few arguments"), color ? "color" : "mono");
341 rc = MUTT_CMD_WARNING;
342 }
343
344 goto done;
345 }
346
348 color_debug(LL_DEBUG5, "color: %s\n", buf_string(buf));
349
350 rc = parse_object(buf, s, &cid, &q_level, err);
351 if (rc != MUTT_CMD_SUCCESS)
352 goto done;
353
354 ac = attr_color_new();
355 rc = callback(buf, s, ac, err);
356 if (rc != MUTT_CMD_SUCCESS)
357 goto done;
358
359 //------------------------------------------------------------------
360 // Business Logic
361
362 if ((ac->fg.type == CT_RGB) || (ac->bg.type == CT_RGB))
363 {
364#ifndef NEOMUTT_DIRECT_COLORS
365 buf_printf(err, _("Direct colors support not compiled in: %s"), buf_string(s));
366 return MUTT_CMD_ERROR;
367#endif
368
369 const bool c_color_directcolor = cs_subset_bool(NeoMutt->sub, "color_directcolor");
370 if (!c_color_directcolor)
371 {
372 buf_printf(err, _("Direct colors support disabled: %s"), buf_string(s));
373 return MUTT_CMD_ERROR;
374 }
375 }
376
377 if ((ac->fg.color >= COLORS) || (ac->bg.color >= COLORS))
378 {
379 buf_printf(err, _("%s: color not supported by term"), buf_string(s));
380 return MUTT_CMD_ERROR;
381 }
382
383 //------------------------------------------------------------------
384
385 /* extract a regular expression if needed */
386
387 if (mutt_color_has_pattern(cid) && (cid != MT_COLOR_STATUS))
388 {
389 color_debug(LL_DEBUG5, "regex needed\n");
390 if (MoreArgs(s))
391 {
393 }
394 else
395 {
396 buf_strcpy(buf, ".*");
397 }
398 }
399
400 if (MoreArgs(s) && (cid != MT_COLOR_STATUS))
401 {
402 buf_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
403 rc = MUTT_CMD_WARNING;
404 goto done;
405 }
406
407 if (regex_colors_parse_color_list(cid, buf->data, ac, &rc, err))
408 {
409 color_debug(LL_DEBUG5, "regex_colors_parse_color_list done\n");
410 goto done;
411 // do nothing
412 }
413 else if (quoted_colors_parse_color(cid, ac, q_level, &rc, err))
414 {
415 color_debug(LL_DEBUG5, "quoted_colors_parse_color done\n");
416 goto done;
417 // do nothing
418 }
419 else if ((cid == MT_COLOR_STATUS) && MoreArgs(s))
420 {
421 color_debug(LL_DEBUG5, "status\n");
422 /* 'color status fg bg' can have up to 2 arguments:
423 * 0 arguments: sets the default status color (handled below by else part)
424 * 1 argument : colorize pattern on match
425 * 2 arguments: colorize nth submatch of pattern */
427
428 if (MoreArgs(s))
429 {
430 struct Buffer *tmp = buf_pool_get();
432 if (!mutt_str_atoui_full(tmp->data, &match))
433 {
434 buf_printf(err, _("%s: invalid number: %s"), color ? "color" : "mono", tmp->data);
435 buf_pool_release(&tmp);
436 rc = MUTT_CMD_WARNING;
437 goto done;
438 }
439 buf_pool_release(&tmp);
440 }
441
442 if (MoreArgs(s))
443 {
444 buf_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
445 rc = MUTT_CMD_WARNING;
446 goto done;
447 }
448
449 rc = regex_colors_parse_status_list(cid, buf->data, ac, match, err);
450 goto done;
451 }
452 else // Remaining simple colours
453 {
454 color_debug(LL_DEBUG5, "simple\n");
455 if (simple_color_set(cid, ac))
456 rc = MUTT_CMD_SUCCESS;
457 else
458 rc = MUTT_CMD_ERROR;
459 }
460
461 if (rc == MUTT_CMD_SUCCESS)
462 {
463 get_colorid_name(cid, buf);
464 color_debug(LL_DEBUG5, "NT_COLOR_SET: %s\n", buf->data);
465 struct EventColor ev_c = { cid, NULL };
467 }
468
469done:
470 attr_color_free(&ac);
471 return rc;
472}
473
477enum CommandResult mutt_parse_uncolor(struct Buffer *buf, struct Buffer *s,
478 intptr_t data, struct Buffer *err)
479{
480 if (OptNoCurses) // No GUI, so quietly discard the command
481 {
482 while (MoreArgs(s))
483 {
485 }
486 return MUTT_CMD_SUCCESS;
487 }
488
489 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(buf));
490 enum CommandResult rc = parse_uncolor(buf, s, err, true);
492 return rc;
493}
494
498enum CommandResult mutt_parse_unmono(struct Buffer *buf, struct Buffer *s,
499 intptr_t data, struct Buffer *err)
500{
501 *s->dptr = '\0'; /* fake that we're done parsing */
502 return MUTT_CMD_SUCCESS;
503}
504
508enum CommandResult mutt_parse_color(struct Buffer *buf, struct Buffer *s,
509 intptr_t data, struct Buffer *err)
510{
511 // No GUI, or no colours, so quietly discard the command
512 if (OptNoCurses || (COLORS == 0))
513 {
514 while (MoreArgs(s))
515 {
517 }
518 return MUTT_CMD_SUCCESS;
519 }
520
521 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(buf));
522 enum CommandResult rc = parse_color(buf, s, err, parse_color_pair, true);
524 return rc;
525}
526
530enum CommandResult mutt_parse_mono(struct Buffer *buf, struct Buffer *s,
531 intptr_t data, struct Buffer *err)
532{
533 // No GUI, or colours available, so quietly discard the command
534 if (OptNoCurses || (COLORS != 0))
535 {
536 while (MoreArgs(s))
537 {
539 }
540 return MUTT_CMD_SUCCESS;
541 }
542
543 color_debug(LL_DEBUG5, "parse: %s\n", buf_string(buf));
544 enum CommandResult rc = parse_color(buf, s, err, parse_attr_spec, false);
546 return rc;
547}
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
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
const struct Mapping ComposeColorFields[]
Mapping of compose colour names to their IDs.
Definition: command.c:111
void get_colorid_name(unsigned int cid, struct Buffer *buf)
Get the name of a color id.
Definition: command.c:127
const struct Mapping ColorFields[]
Mapping of colour names to their IDs.
Definition: command.c:56
static enum CommandResult parse_object(struct Buffer *buf, struct Buffer *s, enum ColorId *cid, int *ql, struct Buffer *err)
Identify a colour object.
Definition: command.c:159
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:321
static enum CommandResult parse_uncolor(struct Buffer *buf, struct Buffer *s, struct Buffer *err, bool uncolor)
Parse an 'uncolor' command.
Definition: command.c:229
void color_dump(void)
Display all the colours in the Pager.
Definition: dump.c:450
struct Notify * ColorsNotify
Notifications: ColorId, EventColor.
Definition: notify.c:35
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:390
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:323
bool regex_colors_parse_uncolor(enum ColorId cid, const char *pat, bool uncolor)
Parse a Regex 'uncolor' command.
Definition: regex.c:418
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:153
void colors_cleanup(void)
Reset all the simple, quoted and regex colours.
Definition: color.c:49
bool mutt_color_has_pattern(enum ColorId cid)
Check if a color object supports a regex pattern.
Definition: color.c:97
Color and attribute parsing.
ColorId
List of all colored objects.
Definition: color.h:40
@ MT_COLOR_SIDEBAR_DIVIDER
Line dividing sidebar from the index/pager.
Definition: color.h:66
@ MT_COLOR_MARKERS
Pager: markers, line continuation.
Definition: color.h:56
@ MT_COLOR_COMPOSE_SECURITY_ENCRYPT
Mail will be encrypted.
Definition: color.h:48
@ MT_COLOR_MESSAGE
Informational message.
Definition: color.h:57
@ MT_COLOR_QUOTED
Pager: quoted text.
Definition: color.h:63
@ MT_COLOR_INDEX_AUTHOR
Index: author field.
Definition: color.h:84
@ MT_COLOR_SIDEBAR_NEW
Mailbox with new mail.
Definition: color.h:70
@ MT_COLOR_HEADER
Message headers (takes a pattern)
Definition: color.h:53
@ MT_COLOR_STATUS
Status bar (takes a pattern)
Definition: color.h:75
@ MT_COLOR_SIDEBAR_UNREAD
Mailbox with unread mail.
Definition: color.h:73
@ MT_COLOR_INDEX_SIZE
Index: size field.
Definition: color.h:90
@ MT_COLOR_INDICATOR
Selected item in list.
Definition: color.h:54
@ MT_COLOR_STRIPE_EVEN
Stripes: even lines of the Help Page.
Definition: color.h:76
@ MT_COLOR_SIDEBAR_SPOOLFILE
$spool_file (Spool mailbox)
Definition: color.h:72
@ MT_COLOR_ERROR
Error message.
Definition: color.h:51
@ MT_COLOR_NONE
Definition: color.h:41
@ MT_COLOR_COMPOSE_SECURITY_NONE
Mail will not be encrypted or signed.
Definition: color.h:49
@ MT_COLOR_SIDEBAR_ORDINARY
Mailbox with no new or flagged messages.
Definition: color.h:71
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
Definition: color.h:93
@ MT_COLOR_BOLD
Bold text.
Definition: color.h:45
@ MT_COLOR_INDEX_SUBJECT
Index: subject field.
Definition: color.h:91
@ MT_COLOR_BODY
Pager: highlight body of message (takes a pattern)
Definition: color.h:44
@ MT_COLOR_INDEX_DATE
Index: date field.
Definition: color.h:86
@ MT_COLOR_PROGRESS
Progress bar.
Definition: color.h:61
@ MT_COLOR_COMPOSE_SECURITY_BOTH
Mail will be encrypted and signed.
Definition: color.h:47
@ MT_COLOR_SIDEBAR_BACKGROUND
Background colour for the Sidebar.
Definition: color.h:65
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
Definition: color.h:92
@ MT_COLOR_HDRDEFAULT
Header default colour.
Definition: color.h:52
@ MT_COLOR_OPTIONS
Options in prompt.
Definition: color.h:60
@ MT_COLOR_TREE
Index: tree-drawing characters.
Definition: color.h:79
@ MT_COLOR_NORMAL
Plain text.
Definition: color.h:59
@ MT_COLOR_ATTACH_HEADERS
MIME attachment test (takes a pattern)
Definition: color.h:43
@ MT_COLOR_SEARCH
Pager: search matches.
Definition: color.h:64
@ MT_COLOR_COMPOSE_SECURITY_SIGN
Mail will be signed.
Definition: color.h:50
@ MT_COLOR_INDEX_LABEL
Index: label field.
Definition: color.h:88
@ MT_COLOR_ITALIC
Italic text.
Definition: color.h:55
@ MT_COLOR_STRIPE_ODD
Stripes: odd lines of the Help Page.
Definition: color.h:77
@ MT_COLOR_PROMPT
Question/user input.
Definition: color.h:62
@ MT_COLOR_COMPOSE_HEADER
Header labels, e.g. From:
Definition: color.h:46
@ MT_COLOR_INDEX
Index: default colour.
Definition: color.h:83
@ MT_COLOR_ATTACHMENT
MIME attachments text (entire line)
Definition: color.h:42
@ MT_COLOR_SIDEBAR_INDICATOR
Current open mailbox.
Definition: color.h:69
@ MT_COLOR_SIDEBAR_HIGHLIGHT
Select cursor.
Definition: color.h:68
@ MT_COLOR_WARNING
Warning messages.
Definition: color.h:81
@ MT_COLOR_UNDERLINE
Underlined text.
Definition: color.h:80
@ MT_COLOR_INDEX_NUMBER
Index: index number.
Definition: color.h:89
@ MT_COLOR_SIGNATURE
Pager: signature lines.
Definition: color.h:74
@ MT_COLOR_INDEX_FLAGS
Index: flags field.
Definition: color.h:87
@ MT_COLOR_SIDEBAR_FLAGGED
Mailbox with flagged messages.
Definition: color.h:67
@ MT_COLOR_TILDE
Pager: empty lines after message.
Definition: color.h:78
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
Definition: color.h:85
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:192
Convenience wrapper for the core headers.
void curses_colors_dump(struct Buffer *buf)
Dump all the Curses colours.
Definition: debug.c:144
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:498
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:530
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:508
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:477
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:672
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:660
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
Definition: string.c:230
Many unsorted constants and some structs.
Colour notifications.
@ NT_COLOR_SET
Color has been set.
Definition: notify2.h:41
@ 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:81
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition: pool.c:94
enum CommandResult quoted_colors_parse_uncolor(enum ColorId cid, int q_level, struct Buffer *err)
Parse the 'uncolor quoted' command.
Definition: quoted.c:176
bool quoted_colors_parse_color(enum ColorId cid, struct AttrColor *ac_val, int q_level, int *rc, struct Buffer *err)
Parse the 'color quoted' command.
Definition: quoted.c:117
Quoted-Email colours.
#define COLOR_QUOTES_MAX
Ten colours, quoted0..quoted9 (quoted and quoted0 are equivalent)
Definition: quoted.h:36
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:53
enum ColorId cid
Colour ID that has changed.
Definition: notify2.h:54
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