NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
commands.c File Reference

Parse colour commands. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "mutt.h"
#include "commands.h"
#include "parse/lib.h"
#include "attr.h"
#include "color.h"
#include "debug.h"
#include "dump.h"
#include "globals.h"
#include "module_data.h"
#include "notify2.h"
#include "parse_color.h"
#include "regex4.h"
#include "simple2.h"
+ Include dependency graph for commands.c:

Go to the source code of this file.

Functions

void get_colorid_name (unsigned int cid, struct Buffer *buf)
 Get the name of a Colour ID.
 
static enum CommandResult parse_object (const struct Command *cmd, struct Buffer *line, enum ColorId *cid, struct Buffer *err)
 Identify a colour object.
 
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() -.
 
static enum CommandResult parse_color_command (const struct Command *cmd, struct Buffer *line, struct Buffer *err, parser_callback_t callback)
 Parse a 'color' command.
 
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() -.
 
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() -.
 
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() -.
 
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() -.
 

Variables

const struct Mapping ColorFields []
 Mapping of colour names to their IDs.
 
const struct Command ColorCommands []
 Colour Commands.
 

Detailed Description

Parse colour commands.

Authors
  • Pietro Cerutti
  • Richard Russon
  • Dennis Schön

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file commands.c.

Function Documentation

◆ get_colorid_name()

void get_colorid_name ( unsigned int cid,
struct Buffer * buf )

Get the name of a Colour ID.

Parameters
cidColour, e.g. MT_COLOR_HEADER
bufBuffer for result

Definition at line 128 of file commands.c.

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}
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
const struct Mapping ColorFields[]
Mapping of colour names to their IDs.
Definition commands.c:55
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Definition mapping.c:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_object()

static enum CommandResult parse_object ( const struct Command * cmd,
struct Buffer * line,
enum ColorId * cid,
struct Buffer * err )
static

Identify a colour object.

Parameters
[in]cmdCommand being parsed
[in]lineBuffer containing string to be parsed
[out]cidObject type, e.g. MT_COLOR_TILDE
[out]errBuffer for error messages
Return values
CommandResultResult e.g. MUTT_CMD_SUCCESS

Identify a colour object, e.g. "message", "compose header"

Definition at line 147 of file commands.c.

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}
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
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
@ MUTT_CMD_SUCCESS
Success: Command worked.
Definition command.h:40
@ MUTT_CMD_WARNING
Warning: Help given to the user.
Definition command.h:39
static int color_debug(enum LogLevel level, const char *format,...)
Definition debug.h:51
int parse_extract_token(struct Buffer *dest, struct Buffer *line, TokenFlags flags)
Extract one token from a string.
Definition extract.c:49
#define MoreArgsF(buf, flags)
Definition extract.h:34
#define MoreArgs(buf)
Definition extract.h:31
@ TOKEN_COMMENT
Don't reap comments.
Definition extract.h:55
@ TOKEN_NONE
No flags are set.
Definition extract.h:49
@ 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
#define _(a)
Definition message.h:28
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition string.c:677
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
String manipulation buffer.
Definition buffer.h:36
const char * name
Name of the Command.
Definition command.h:162
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_color_command()

static enum CommandResult parse_color_command ( const struct Command * cmd,
struct Buffer * line,
struct Buffer * err,
parser_callback_t callback )
static

Parse a 'color' command.

Parameters
cmdCommand being parsed
lineBuffer containing string to be parsed
errBuffer for error messages
callbackFunction to handle command - Implements parser_callback_t
Return values
CommandResultResult e.g. MUTT_CMD_SUCCESS

Usage:

  • color OBJECT [ ATTRS ] FG BG [ PATTERN | REGEX ] [ NUM ]
  • mono OBJECT ATTRS [ PATTERN | REGEX ] [ NUM ]

Definition at line 292 of file commands.c.

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}
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
@ CT_RGB
True colour, e.g. "#11AAFF".
Definition attr.h:37
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
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
void color_dump(void)
Display all the colours in the Pager.
Definition dump.c:450
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
struct AttrColor * simple_color_set(enum ColorId cid, struct AttrColor *ac_val)
Set the colour of a simple object.
Definition simple.c:131
bool mutt_color_has_pattern(enum ColorId cid)
Check if a color object supports a regex pattern.
Definition color.c:102
ColorId
List of all coloured objects.
Definition color.h:35
@ MT_COLOR_STATUS
Status bar (takes a pattern)
Definition color.h:78
@ MT_COLOR_NONE
No colour.
Definition color.h:36
CommandResult
Error codes for command_t parse functions.
Definition command.h:37
@ MUTT_CMD_ERROR
Error: Can't help the user.
Definition command.h:38
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
bool StartupComplete
When the config has been read.
Definition address.c:11
@ MODULE_ID_COLOR
ModuleColor, Color
Definition module_api.h:53
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
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:663
@ NT_COLOR_SET
Color has been set.
Definition notify2.h:40
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
Definition notify_type.h:41
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
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
An Event that happened to a Colour.
Definition notify2.h:52
enum ColorId cid
Colour ID that has changed.
Definition notify2.h:53
Container for Accounts, Notifications.
Definition neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ ColorFields

const struct Mapping ColorFields[]

Mapping of colour names to their IDs.

Definition at line 55 of file commands.c.

55 {
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};
@ 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_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_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

◆ ColorCommands

const struct Command ColorCommands[]
Initial value:
= {
{ "color", CMD_COLOR, parse_color,
N_("Define colors for the user interface"),
N_("color <object> [ <attribute> ... ] <fg> <bg> [ <regex> [ <num> ]]"),
"configuration.html#color" },
{ "mono", CMD_MONO, parse_mono,
N_("Deprecated: Use `color` instead"),
N_("mono <object> <attribute> [ <pattern> | <regex> ]"),
"configuration.html#color-mono" },
{ "uncolor", CMD_UNCOLOR, parse_uncolor,
N_("Remove a `color` definition"),
N_("uncolor <object> { * | <pattern> ... }"),
"configuration.html#color" },
{ "unmono", CMD_UNMONO, parse_unmono,
N_("Deprecated: Use `uncolor` instead"),
N_("unmono <object> { * | <pattern> ... }"),
"configuration.html#color-mono" },
{ NULL, CMD_NONE, NULL, NULL, NULL, NULL, CF_NONE },
}
@ 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
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_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
#define N_(a)
Definition message.h:32

Colour Commands.

Definition at line 571 of file commands.c.

571 {
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};