NeoMutt  2018-07-16 +1360-3df4a2
Teaching an old dog new tricks
DOXYGEN
color.c File Reference

Color and attribute parsing. More...

#include "config.h"
#include <regex.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mutt/mutt.h"
#include "email/lib.h"
#include "mutt.h"
#include "color.h"
#include "context.h"
#include "globals.h"
#include "keymap.h"
#include "mailbox.h"
#include "mutt_commands.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "options.h"
#include "pattern.h"
+ Include dependency graph for color.c:

Go to the source code of this file.

Macros

#define COLOR_QUOTE_INIT   8
 

Typedefs

typedef int(* parser_callback_t) (struct Buffer *buf, struct Buffer *s, int *fg, int *bg, int *attr, struct Buffer *err)
 typedef parser_callback_t - Prototype for a function to parse color config More...
 

Functions

static struct ColorLinenew_color_line (void)
 Create a new ColorLine. More...
 
static void free_color_line (struct ColorLine *tmp, bool free_colors)
 Free a ColorLine. More...
 
void ci_start_color (void)
 Set up the default colours. More...
 
static void do_uncolor (struct Buffer *buf, struct Buffer *s, struct ColorLineHead *cl, bool *do_cache, bool parse_uncolor)
 Parse the "uncolor" or "unmono" command. More...
 
static enum CommandResult parse_uncolor (struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err, bool parse_uncolor)
 Parse an 'uncolor' command. More...
 
enum CommandResult mutt_parse_unmono (struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err)
 Parse the 'unmono' command - Implements command_t. More...
 
static enum CommandResult add_pattern (struct ColorLineHead *top, const char *s, bool sensitive, int fg, int bg, int attr, struct Buffer *err, bool is_index, int match)
 Associate a colour to a pattern. More...
 
static int parse_object (struct Buffer *buf, struct Buffer *s, int *o, int *ql, struct Buffer *err)
 Parse a colour config line. More...
 
static int parse_attr_spec (struct Buffer *buf, struct Buffer *s, int *fg, int *bg, int *attr, struct Buffer *err)
 Parse an attribute description - Implements parser_callback_t. More...
 
static int fgbgattr_to_color (int fg, int bg, int attr)
 Convert a foreground, background, attribute triplet into a colour. More...
 
static enum CommandResult parse_color (struct Buffer *buf, struct Buffer *s, struct Buffer *err, parser_callback_t callback, bool dry_run, bool color)
 Parse a "color" command. More...
 
enum CommandResult mutt_parse_mono (struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err)
 Parse the 'mono' command - Implements command_t. More...
 
static void mutt_free_color_list (struct ColorLineHead *head)
 Free a list of colours. More...
 
void mutt_free_colors (void)
 Free all the colours (on shutdown) More...
 

Variables

int * ColorQuote = NULL
 Array of colours for quoted email text. More...
 
int ColorQuoteUsed
 Number of colours for quoted email text. More...
 
int ColorDefs [MT_COLOR_MAX]
 Array of all fixed colours, see enum ColorId. More...
 
struct ColorLineHead ColorAttachList = STAILQ_HEAD_INITIALIZER(ColorAttachList)
 List of colours applied to the attachment headers. More...
 
struct ColorLineHead ColorBodyList = STAILQ_HEAD_INITIALIZER(ColorBodyList)
 List of colours applied to the email body. More...
 
struct ColorLineHead ColorHdrList = STAILQ_HEAD_INITIALIZER(ColorHdrList)
 List of colours applied to the email headers. More...
 
struct ColorLineHead ColorIndexAuthorList = STAILQ_HEAD_INITIALIZER(ColorIndexAuthorList)
 List of colours applied to the author in the index. More...
 
struct ColorLineHead ColorIndexFlagsList = STAILQ_HEAD_INITIALIZER(ColorIndexFlagsList)
 List of colours applied to the flags in the index. More...
 
struct ColorLineHead ColorIndexList = STAILQ_HEAD_INITIALIZER(ColorIndexList)
 List of default colours applied to the index. More...
 
struct ColorLineHead ColorIndexSubjectList = STAILQ_HEAD_INITIALIZER(ColorIndexSubjectList)
 List of colours applied to the subject in the index. More...
 
struct ColorLineHead ColorIndexTagList = STAILQ_HEAD_INITIALIZER(ColorIndexTagList)
 List of colours applied to tags in the index. More...
 
struct ColorLineHead ColorStatusList = STAILQ_HEAD_INITIALIZER(ColorStatusList)
 List of colours applied to the status bar. More...
 
static int ColorQuoteSize
 
static const struct Mapping Fields []
 
static const struct Mapping ComposeFields []
 

Detailed Description

Color and attribute parsing.

Authors
  • Michael R. Elkins

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 color.c.

Macro Definition Documentation

#define COLOR_QUOTE_INIT   8

Definition at line 155 of file color.c.

Typedef Documentation

typedef int(* parser_callback_t) (struct Buffer *buf, struct Buffer *s, int *fg, int *bg, int *attr, struct Buffer *err)

typedef parser_callback_t - Prototype for a function to parse color config

Parameters
[in]bufTemporary Buffer space
[in]sBuffer containing string to be parsed
[out]fgForeground colour (set to -1)
[out]bgBackground colour (set to -1)
[out]attrAttribute flags
[out]errBuffer for error messages
Return values
0Success
-1Error

Definition at line 890 of file color.c.

Function Documentation

static struct ColorLine* new_color_line ( void  )
static

Create a new ColorLine.

Return values
ptrNewly allocated ColorLine

Definition at line 161 of file color.c.

162 {
163  struct ColorLine *p = mutt_mem_calloc(1, sizeof(struct ColorLine));
164 
165  p->fg = -1;
166  p->bg = -1;
167  return p;
168 }
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:51
short fg
Definition: mutt_curses.h:185
short bg
Definition: mutt_curses.h:186
A regular expression and a color to highlight a line.
Definition: mutt_curses.h:178

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void free_color_line ( struct ColorLine tmp,
bool  free_colors 
)
static

Free a ColorLine.

Parameters
tmpColorLine to free
free_colorsIf true, free its colours too

Definition at line 175 of file color.c.

176 {
177  if (!tmp)
178  return;
179 
180 #ifdef HAVE_COLOR
181  if (free_colors && (tmp->fg != -1) && (tmp->bg != -1))
182  mutt_free_color(tmp->fg, tmp->bg);
183 #endif
184 
185  /* we should really introduce a container type for regular expressions. */
186  regfree(&tmp->regex);
188  FREE(&tmp->pattern);
189  FREE(&tmp);
190 }
char * pattern
Definition: mutt_curses.h:182
void mutt_pattern_free(struct Pattern **pat)
Free a Pattern.
Definition: pattern.c:1338
struct Pattern * color_pattern
compiled pattern to speed up index color calculation
Definition: mutt_curses.h:183
void mutt_free_color(int fg, int bg)
regex_t regex
Definition: mutt_curses.h:180
short fg
Definition: mutt_curses.h:185
#define FREE(x)
Definition: memory.h:40
short bg
Definition: mutt_curses.h:186

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ci_start_color ( void  )

Set up the default colours.

Definition at line 195 of file color.c.

196 {
197  memset(ColorDefs, A_NORMAL, sizeof(int) * MT_COLOR_MAX);
199  memset(ColorQuote, A_NORMAL, sizeof(int) * COLOR_QUOTE_INIT);
201  ColorQuoteUsed = 0;
202 
203  /* set some defaults */
204  ColorDefs[MT_COLOR_STATUS] = A_REVERSE;
205  ColorDefs[MT_COLOR_INDICATOR] = A_REVERSE;
206  ColorDefs[MT_COLOR_SEARCH] = A_REVERSE;
207  ColorDefs[MT_COLOR_MARKERS] = A_REVERSE;
208 #ifdef USE_SIDEBAR
209  ColorDefs[MT_COLOR_HIGHLIGHT] = A_UNDERLINE;
210 #endif
211  /* special meaning: toggle the relevant attribute */
214 
215 #ifdef HAVE_COLOR
216  start_color();
217 #endif
218 }
int * ColorQuote
Array of colours for quoted email text.
Definition: color.c:50
Bold text.
Definition: mutt_curses.h:140
static int ColorQuoteSize
Definition: color.c:64
int ColorQuoteUsed
Number of colours for quoted email text.
Definition: color.c:51
Pager: search matches.
Definition: mutt_curses.h:139
Pager: markers, line continuation.
Definition: mutt_curses.h:133
Underlined text.
Definition: mutt_curses.h:141
Select cursor.
Definition: mutt_curses.h:147
void * mutt_mem_malloc(size_t size)
Allocate memory on the heap.
Definition: memory.c:99
#define COLOR_QUOTE_INIT
Definition: color.c:155
int ColorDefs[MT_COLOR_MAX]
Array of all fixed colours, see enum ColorId.
Definition: color.c:52
Status bar.
Definition: mutt_curses.h:128
Selected item in list.
Definition: mutt_curses.h:127

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void do_uncolor ( struct Buffer buf,
struct Buffer s,
struct ColorLineHead *  cl,
bool *  do_cache,
bool  parse_uncolor 
)
static

Parse the "uncolor" or "unmono" command.

Parameters
[in]bufBuffer for temporary storage
[in]sBuffer containing the uncolor command
[in]clList of existing colours
[in,out]do_cacheSet to true if colours were freed
[in]parse_uncolorIf true, 'uncolor', else 'unmono'

Definition at line 534 of file color.c.

536 {
537  struct ColorLine *np = NULL, *tmp = NULL;
538  do
539  {
540  mutt_extract_token(buf, s, 0);
541  if (mutt_str_strcmp("*", buf->data) == 0)
542  {
543  np = STAILQ_FIRST(cl);
544  while (np)
545  {
546  tmp = STAILQ_NEXT(np, entries);
547  if (!*do_cache)
548  {
549  *do_cache = true;
550  }
552  np = tmp;
553  }
554  STAILQ_INIT(cl);
555  return;
556  }
557  else
558  {
559  tmp = NULL;
560  STAILQ_FOREACH(np, cl, entries)
561  {
562  if (mutt_str_strcmp(buf->data, np->pattern) == 0)
563  {
564  if (!*do_cache)
565  {
566  *do_cache = true;
567  }
568  mutt_debug(LL_DEBUG1, "Freeing pattern \"%s\" from ColorList\n", buf->data);
569  if (tmp)
570  STAILQ_REMOVE_AFTER(cl, tmp, entries);
571  else
572  STAILQ_REMOVE_HEAD(cl, entries);
574  break;
575  }
576  tmp = np;
577  }
578  }
579  } while (MoreArgs(s));
580 }
char * pattern
Definition: mutt_curses.h:182
#define STAILQ_REMOVE_HEAD(head, field)
Definition: queue.h:420
#define MoreArgs(buf)
Definition: buffer.h:44
#define STAILQ_INIT(head)
Definition: queue.h:370
static enum CommandResult parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err, bool parse_uncolor)
Parse an &#39;uncolor&#39; command.
Definition: color.c:595
static void free_color_line(struct ColorLine *tmp, bool free_colors)
Free a ColorLine.
Definition: color.c:175
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:2659
char * data
pointer to data
Definition: buffer.h:35
#define STAILQ_FOREACH(var, head, field)
Definition: queue.h:350
#define STAILQ_NEXT(elm, field)
Definition: queue.h:398
Log at debug level 1.
Definition: logging.h:56
#define mutt_debug(LEVEL,...)
Definition: logging.h:85
#define STAILQ_FIRST(head)
Definition: queue.h:348
#define STAILQ_REMOVE_AFTER(head, elm, field)
Definition: queue.h:414
int mutt_str_strcmp(const char *a, const char *b)
Compare two strings, safely.
Definition: string.c:611
A regular expression and a color to highlight a line.
Definition: mutt_curses.h:178

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static enum CommandResult parse_uncolor ( struct Buffer buf,
struct Buffer s,
unsigned long  data,
struct Buffer err,
bool  parse_uncolor 
)
static

Parse an 'uncolor' command.

Parameters
bufTemporary Buffer space
sBuffer containing string to be parsed
dataFlags associated with the command
errBuffer for error messages
parse_uncolorIf true, 'uncolor', else 'unmono'
Return values
enume.g. MUTT_CMD_SUCCESS

usage:

  • uncolor index pattern [pattern...]
  • unmono index pattern [pattern...]

Definition at line 595 of file color.c.

597 {
598  int object = 0;
599  bool do_cache = false;
600 
601  mutt_extract_token(buf, s, 0);
602 
603  object = mutt_map_get_value(buf->data, Fields);
604  if (object == -1)
605  {
606  mutt_buffer_printf(err, _("%s: no such object"), buf->data);
607  return MUTT_CMD_ERROR;
608  }
609 
610  if (object > MT_COLOR_INDEX_SUBJECT)
611  { /* uncolor index column */
612  ColorDefs[object] = 0;
614  return MUTT_CMD_SUCCESS;
615  }
616 
617  if (!mutt_str_startswith(buf->data, "body", CASE_MATCH) &&
618  !mutt_str_startswith(buf->data, "header", CASE_MATCH) &&
619  !mutt_str_startswith(buf->data, "index", CASE_MATCH))
620  {
621  mutt_buffer_printf(err, _("%s: command valid only for index, body, header objects"),
622  parse_uncolor ? "uncolor" : "unmono");
623  return MUTT_CMD_WARNING;
624  }
625 
626  if (!MoreArgs(s))
627  {
628  mutt_buffer_printf(err, _("%s: too few arguments"), parse_uncolor ? "uncolor" : "unmono");
629  return MUTT_CMD_WARNING;
630  }
631 
632  if (
633 #ifdef HAVE_COLOR
634  /* we're running without curses */
635  OptNoCurses || /* we're parsing an uncolor command, and have no colors */
636  (parse_uncolor && !has_colors())
637  /* we're parsing an unmono command, and have colors */
638  || (!parse_uncolor && has_colors())
639 #else
640  /* We don't even have colors compiled in */
642 #endif
643  )
644  {
645  /* just eat the command, but don't do anything real about it */
646  do
647  mutt_extract_token(buf, s, 0);
648  while (MoreArgs(s));
649 
650  return MUTT_CMD_SUCCESS;
651  }
652 
653  if (object == MT_COLOR_BODY)
654  do_uncolor(buf, s, &ColorBodyList, &do_cache, parse_uncolor);
655  else if (object == MT_COLOR_HEADER)
656  do_uncolor(buf, s, &ColorHdrList, &do_cache, parse_uncolor);
657  else if (object == MT_COLOR_ATTACH_HEADERS)
658  do_uncolor(buf, s, &ColorAttachList, &do_cache, parse_uncolor);
659  else if (object == MT_COLOR_INDEX)
660  do_uncolor(buf, s, &ColorIndexList, &do_cache, parse_uncolor);
661  else if (object == MT_COLOR_INDEX_AUTHOR)
662  do_uncolor(buf, s, &ColorIndexAuthorList, &do_cache, parse_uncolor);
663  else if (object == MT_COLOR_INDEX_FLAGS)
664  do_uncolor(buf, s, &ColorIndexFlagsList, &do_cache, parse_uncolor);
665  else if (object == MT_COLOR_INDEX_SUBJECT)
666  do_uncolor(buf, s, &ColorIndexSubjectList, &do_cache, parse_uncolor);
667  else if (object == MT_COLOR_INDEX_TAG)
668  do_uncolor(buf, s, &ColorIndexTagList, &do_cache, parse_uncolor);
669 
670  bool is_index = ((object == MT_COLOR_INDEX) || (object == MT_COLOR_INDEX_AUTHOR) ||
671  (object == MT_COLOR_INDEX_FLAGS) || (object == MT_COLOR_INDEX_SUBJECT) ||
672  (object == MT_COLOR_INDEX_TAG));
673 
674  if (is_index && do_cache && !OptNoCurses)
675  {
677  /* force re-caching of index colors */
678  for (int i = 0; Context && i < Context->mailbox->msg_count; i++)
679  Context->mailbox->emails[i]->pair = 0;
680  }
681  return MUTT_CMD_SUCCESS;
682 }
struct Email ** emails
Definition: mailbox.h:100
Index: subject field (takes a pattern)
Definition: mutt_curses.h:159
The "current" mailbox.
Definition: context.h:37
int msg_count
total number of messages
Definition: mailbox.h:93
Error: Can&#39;t help the user.
Definition: mutt_commands.h:33
struct ColorLineHead ColorIndexFlagsList
List of colours applied to the flags in the index.
Definition: color.c:57
static void do_uncolor(struct Buffer *buf, struct Buffer *s, struct ColorLineHead *cl, bool *do_cache, bool parse_uncolor)
Parse the "uncolor" or "unmono" command.
Definition: color.c:534
struct ColorLineHead ColorBodyList
List of colours applied to the email body.
Definition: color.c:54
#define _(a)
Definition: message.h:28
Message headers (takes a pattern)
Definition: mutt_curses.h:135
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:45
Match case when comparing strings.
Definition: string2.h:66
Index panel (list of emails)
Definition: keymap.h:74
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:200
#define MoreArgs(buf)
Definition: buffer.h:44
struct Mailbox * mailbox
Definition: context.h:51
Index: default colour (takes a pattern)
Definition: mutt_curses.h:155
struct ColorLineHead ColorIndexAuthorList
List of colours applied to the author in the index.
Definition: color.c:56
static enum CommandResult parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err, bool parse_uncolor)
Parse an &#39;uncolor&#39; command.
Definition: color.c:595
Index: tag field (g, takes a pattern)
Definition: mutt_curses.h:158
Index: flags field (takes a pattern)
Definition: mutt_curses.h:157
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:2659
Index: author field (takes a pattern)
Definition: mutt_curses.h:156
char * data
pointer to data
Definition: buffer.h:35
Pager: highlight body of message (takes a pattern)
Definition: mutt_curses.h:134
struct ColorLineHead ColorHdrList
List of colours applied to the email headers.
Definition: color.c:55
int ColorDefs[MT_COLOR_MAX]
Array of all fixed colours, see enum ColorId.
Definition: color.c:52
size_t mutt_str_startswith(const char *str, const char *prefix, enum CaseSensitivity cs)
Check whether a string starts with a prefix.
Definition: string.c:165
Success: Command worked.
Definition: mutt_commands.h:35
Warning: Help given to the user.
Definition: mutt_commands.h:34
MIME attachment test (takes a pattern)
Definition: mutt_curses.h:138
struct ColorLineHead ColorIndexSubjectList
List of colours applied to the subject in the index.
Definition: color.c:59
struct ColorLineHead ColorIndexTagList
List of colours applied to tags in the index.
Definition: color.c:60
struct ColorLineHead ColorIndexList
List of default colours applied to the index.
Definition: color.c:58
int pair
color-pair to use when displaying in the index
Definition: email.h:82
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.
Definition: mapping.c:61
static const struct Mapping Fields[]
Definition: color.c:102
struct ColorLineHead ColorAttachList
List of colours applied to the attachment headers.
Definition: color.c:53

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

enum CommandResult mutt_parse_unmono ( struct Buffer buf,
struct Buffer s,
unsigned long  data,
struct Buffer err 
)

Parse the 'unmono' command - Implements command_t.

Definition at line 700 of file color.c.

702 {
703  return parse_uncolor(buf, s, data, err, false);
704 }
static enum CommandResult parse_uncolor(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err, bool parse_uncolor)
Parse an &#39;uncolor&#39; command.
Definition: color.c:595

+ Here is the call graph for this function:

static enum CommandResult add_pattern ( struct ColorLineHead *  top,
const char *  s,
bool  sensitive,
int  fg,
int  bg,
int  attr,
struct Buffer err,
bool  is_index,
int  match 
)
static

Associate a colour to a pattern.

Parameters
topList of existing colours
sString to match
sensitivetrue if the pattern case-sensitive
fgForeground colour ID
bgBackground colour ID
attrAttribute flags, e.g. A_BOLD
errBuffer for error messages
is_indextrue of this is for the index
matchNumber of regex subexpression to match (0 for entire pattern)
Return values
enume.g. MUTT_CMD_SUCCESS

Definition at line 719 of file color.c.

722 {
723  /* is_index used to store compiled pattern
724  * only for 'index' color object
725  * when called from mutt_parse_color() */
726 
727  struct ColorLine *tmp = NULL;
728 
729  STAILQ_FOREACH(tmp, top, entries)
730  {
731  if (sensitive)
732  {
733  if (mutt_str_strcmp(s, tmp->pattern) == 0)
734  break;
735  }
736  else
737  {
738  if (mutt_str_strcasecmp(s, tmp->pattern) == 0)
739  break;
740  }
741  }
742 
743  if (tmp)
744  {
745 #ifdef HAVE_COLOR
746  if ((fg != -1) && (bg != -1))
747  {
748  if ((tmp->fg != fg) || (tmp->bg != bg))
749  {
750  mutt_free_color(tmp->fg, tmp->bg);
751  tmp->fg = fg;
752  tmp->bg = bg;
753  attr |= mutt_alloc_color(fg, bg);
754  }
755  else
756  attr |= (tmp->pair & ~A_BOLD);
757  }
758 #endif /* HAVE_COLOR */
759  tmp->pair = attr;
760  }
761  else
762  {
763  tmp = new_color_line();
764  if (is_index)
765  {
766  char buf[1024];
767  mutt_str_strfcpy(buf, s, sizeof(buf));
768  mutt_check_simple(buf, sizeof(buf), NONULL(C_SimpleSearch));
770  if (!tmp->color_pattern)
771  {
772  free_color_line(tmp, true);
773  return MUTT_CMD_ERROR;
774  }
775  }
776  else
777  {
778  int flags = 0;
779  if (sensitive)
780  flags = mutt_mb_is_lower(s) ? REG_ICASE : 0;
781  else
782  flags = REG_ICASE;
783 
784  const int r = REGCOMP(&tmp->regex, s, flags);
785  if (r != 0)
786  {
787  regerror(r, &tmp->regex, err->data, err->dsize);
788  free_color_line(tmp, true);
789  return MUTT_CMD_ERROR;
790  }
791  }
792  tmp->pattern = mutt_str_strdup(s);
793  tmp->match = match;
794 #ifdef HAVE_COLOR
795  if ((fg != -1) && (bg != -1))
796  {
797  tmp->fg = fg;
798  tmp->bg = bg;
799  attr |= mutt_alloc_color(fg, bg);
800  }
801 #endif
802  tmp->pair = attr;
803  STAILQ_INSERT_HEAD(top, tmp, entries);
804  }
805 
806  /* force re-caching of index colors */
807  if (is_index)
808  {
809  for (int i = 0; Context && i < Context->mailbox->msg_count; i++)
810  Context->mailbox->emails[i]->pair = 0;
811  }
812 
813  return MUTT_CMD_SUCCESS;
814 }
struct Email ** emails
Definition: mailbox.h:100
The "current" mailbox.
Definition: context.h:37
#define NONULL(x)
Definition: string2.h:36
int msg_count
total number of messages
Definition: mailbox.h:93
int mutt_alloc_color(int fg, int bg)
Error: Can&#39;t help the user.
Definition: mutt_commands.h:33
#define MUTT_FULL_MSG
Definition: pattern.h:40
char * pattern
Definition: mutt_curses.h:182
int match
which substringmap 0 for old behaviour
Definition: mutt_curses.h:181
size_t dsize
length of data
Definition: buffer.h:37
struct Mailbox * mailbox
Definition: context.h:51
struct Pattern * color_pattern
compiled pattern to speed up index color calculation
Definition: mutt_curses.h:183
static struct ColorLine * new_color_line(void)
Create a new ColorLine.
Definition: color.c:161
static void free_color_line(struct ColorLine *tmp, bool free_colors)
Free a ColorLine.
Definition: color.c:175
char * data
pointer to data
Definition: buffer.h:35
size_t mutt_str_strfcpy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:741
#define STAILQ_INSERT_HEAD(head, elm, field)
Definition: queue.h:381
#define STAILQ_FOREACH(var, head, field)
Definition: queue.h:350
struct Pattern * mutt_pattern_comp(char *s, int flags, struct Buffer *err)
Create a Pattern.
Definition: pattern.c:1383
void mutt_free_color(int fg, int bg)
WHERE char * C_SimpleSearch
Config: Pattern to search for when search doesn&#39;t contain ~&#39;s.
Definition: globals.h:146
regex_t regex
Definition: mutt_curses.h:180
Success: Command worked.
Definition: mutt_commands.h:35
char * mutt_str_strdup(const char *str)
Copy a string, safely.
Definition: string.c:383
short fg
Definition: mutt_curses.h:185
int mutt_str_strcasecmp(const char *a, const char *b)
Compare two strings ignoring case, safely.
Definition: string.c:624
void mutt_check_simple(char *s, size_t len, const char *simple)
Convert a simple search into a real request.
Definition: pattern.c:2211
#define REGCOMP(preg, regex, cflags)
Compile a regular expression.
Definition: regex3.h:52
short bg
Definition: mutt_curses.h:186
bool mutt_mb_is_lower(const char *s)
Does a multi-byte string contain only lowercase characters?
Definition: mbyte.c:346
int mutt_str_strcmp(const char *a, const char *b)
Compare two strings, safely.
Definition: string.c:611
int pair
color-pair to use when displaying in the index
Definition: email.h:82
A regular expression and a color to highlight a line.
Definition: mutt_curses.h:178

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int parse_object ( struct Buffer buf,
struct Buffer s,
int *  o,
int *  ql,
struct Buffer err 
)
static

Parse a colour config line.

Parameters
[in]bufTemporary Buffer space
[in]sBuffer containing string to be parsed
[out]oIndex into the fields map
[out]qlQuote level
[out]errBuffer for error messages
Return values
0Success
-1Error

Definition at line 826 of file color.c.

828 {
829  if (!MoreArgs(s))
830  {
831  mutt_buffer_printf(err, _("%s: too few arguments"), "color");
832  return -1;
833  }
834 
835  mutt_extract_token(buf, s, 0);
836  if (mutt_str_startswith(buf->data, "quoted", CASE_MATCH))
837  {
838  if (buf->data[6])
839  {
840  char *eptr = NULL;
841  *ql = strtol(buf->data + 6, &eptr, 10);
842  if (*eptr || (*ql < 0))
843  {
844  mutt_buffer_printf(err, _("%s: no such object"), buf->data);
845  return -1;
846  }
847  }
848  else
849  *ql = 0;
850 
851  *o = MT_COLOR_QUOTED;
852  }
853  else if (mutt_str_strcasecmp(buf->data, "compose") == 0)
854  {
855  if (!MoreArgs(s))
856  {
857  mutt_buffer_printf(err, _("%s: too few arguments"), "color");
858  return -1;
859  }
860 
861  mutt_extract_token(buf, s, 0);
862 
864  if (*o == -1)
865  {
866  mutt_buffer_printf(err, _("%s: no such object"), buf->data);
867  return -1;
868  }
869  }
870  else if ((*o = mutt_map_get_value(buf->data, Fields)) == -1)
871  {
872  mutt_buffer_printf(err, _("%s: no such object"), buf->data);
873  return -1;
874  }
875 
876  return 0;
877 }
static const struct Mapping ComposeFields[]
Definition: color.c:146
Pager: quoted text.
Definition: mutt_curses.h:125
#define _(a)
Definition: message.h:28
Match case when comparing strings.
Definition: string2.h:66
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:200
#define MoreArgs(buf)
Definition: buffer.h:44
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:2659
char * data
pointer to data
Definition: buffer.h:35
size_t mutt_str_startswith(const char *str, const char *prefix, enum CaseSensitivity cs)
Check whether a string starts with a prefix.
Definition: string.c:165
int mutt_str_strcasecmp(const char *a, const char *b)
Compare two strings ignoring case, safely.
Definition: string.c:624
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.
Definition: mapping.c:61
static const struct Mapping Fields[]
Definition: color.c:102

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int parse_attr_spec ( struct Buffer buf,
struct Buffer s,
int *  fg,
int *  bg,
int *  attr,
struct Buffer err 
)
static

Parse an attribute description - Implements parser_callback_t.

Definition at line 950 of file color.c.

952 {
953  if (fg)
954  *fg = -1;
955  if (bg)
956  *bg = -1;
957 
958  if (!MoreArgs(s))
959  {
960  mutt_buffer_printf(err, _("%s: too few arguments"), "mono");
961  return -1;
962  }
963 
964  mutt_extract_token(buf, s, 0);
965 
966  if (mutt_str_strcasecmp("bold", buf->data) == 0)
967  *attr |= A_BOLD;
968  else if (mutt_str_strcasecmp("underline", buf->data) == 0)
969  *attr |= A_UNDERLINE;
970  else if (mutt_str_strcasecmp("none", buf->data) == 0)
971  *attr = A_NORMAL;
972  else if (mutt_str_strcasecmp("reverse", buf->data) == 0)
973  *attr |= A_REVERSE;
974  else if (mutt_str_strcasecmp("standout", buf->data) == 0)
975  *attr |= A_STANDOUT;
976  else if (mutt_str_strcasecmp("normal", buf->data) == 0)
977  *attr = A_NORMAL; /* needs use = instead of |= to clear other bits */
978  else
979  {
980  mutt_buffer_printf(err, _("%s: no such attribute"), buf->data);
981  return -1;
982  }
983 
984  return 0;
985 }
#define _(a)
Definition: message.h:28
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:200
#define MoreArgs(buf)
Definition: buffer.h:44
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:2659
char * data
pointer to data
Definition: buffer.h:35
short fg
Definition: mutt_curses.h:185
int mutt_str_strcasecmp(const char *a, const char *b)
Compare two strings ignoring case, safely.
Definition: string.c:624
short bg
Definition: mutt_curses.h:186

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int fgbgattr_to_color ( int  fg,
int  bg,
int  attr 
)
static

Convert a foreground, background, attribute triplet into a colour.

Parameters
fgForeground colour ID
bgBackground colour ID
attrAttribute flags, e.g. A_BOLD
Return values
numCombined colour pair

Definition at line 994 of file color.c.

995 {
996 #ifdef HAVE_COLOR
997  if ((fg != -1) && (bg != -1))
998  return attr | mutt_alloc_color(fg, bg);
999  else
1000 #endif
1001  return attr;
1002 }
int mutt_alloc_color(int fg, int bg)
short fg
Definition: mutt_curses.h:185
short bg
Definition: mutt_curses.h:186

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static enum CommandResult parse_color ( struct Buffer buf,
struct Buffer s,
struct Buffer err,
parser_callback_t  callback,
bool  dry_run,
bool  color 
)
static

Parse a "color" command.

Parameters
bufTemporary Buffer space
sBuffer containing string to be parsed
errBuffer for error messages
callbackFunction to handle command - Implements parser_callback_t
dry_runIf true, test the command, but don't apply it
colorIf true "color", else "mono"
Return values
enume.g. MUTT_CMD_SUCCESS

usage: color OBJECT FG BG [ REGEX ] mono OBJECT ATTR [ REGEX ]

Definition at line 1017 of file color.c.

1020 {
1021  int object = 0, attr = 0, fg = 0, bg = 0, q_level = 0, match = 0;
1022  enum CommandResult rc = MUTT_CMD_SUCCESS;
1023 
1024  if (parse_object(buf, s, &object, &q_level, err) == -1)
1025  return MUTT_CMD_ERROR;
1026 
1027  if (callback(buf, s, &fg, &bg, &attr, err) == -1)
1028  return MUTT_CMD_ERROR;
1029 
1030  /* extract a regular expression if needed */
1031 
1032  if ((object == MT_COLOR_BODY) || (object == MT_COLOR_HEADER) ||
1033  (object == MT_COLOR_ATTACH_HEADERS) || (object == MT_COLOR_INDEX) ||
1034  (object == MT_COLOR_INDEX_AUTHOR) || (object == MT_COLOR_INDEX_FLAGS) ||
1035  (object == MT_COLOR_INDEX_TAG) || (object == MT_COLOR_INDEX_SUBJECT))
1036  {
1037  if (!MoreArgs(s))
1038  {
1039  mutt_buffer_printf(err, _("%s: too few arguments"), color ? "color" : "mono");
1040  return MUTT_CMD_WARNING;
1041  }
1042 
1043  mutt_extract_token(buf, s, 0);
1044  }
1045 
1046  if (MoreArgs(s) && (object != MT_COLOR_STATUS))
1047  {
1048  mutt_buffer_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
1049  return MUTT_CMD_WARNING;
1050  }
1051 
1052  /* dry run? */
1053 
1054  if (dry_run)
1055  {
1056  *s->dptr = '\0'; /* fake that we're done parsing */
1057  return MUTT_CMD_SUCCESS;
1058  }
1059 
1060 #ifdef HAVE_COLOR
1061 #ifdef HAVE_USE_DEFAULT_COLORS
1062  if (!OptNoCurses &&
1063  has_colors()
1064  /* delay use_default_colors() until needed, since it initializes things */
1065  && ((fg == COLOR_DEFAULT) || (bg == COLOR_DEFAULT) || (object == MT_COLOR_TREE)) &&
1066  (use_default_colors() != OK))
1067  /* the case of the tree object is special, because a non-default fg color of
1068  * the tree element may be combined dynamically with the default bg color of
1069  * an index line, not necessarily defined in a rc file. */
1070  {
1071  mutt_buffer_strcpy(err, _("default colors not supported"));
1072  return MUTT_CMD_ERROR;
1073  }
1074 #endif /* HAVE_USE_DEFAULT_COLORS */
1075 #endif
1076 
1077  if (object == MT_COLOR_HEADER)
1078  rc = add_pattern(&ColorHdrList, buf->data, false, fg, bg, attr, err, false, match);
1079  else if (object == MT_COLOR_BODY)
1080  rc = add_pattern(&ColorBodyList, buf->data, true, fg, bg, attr, err, false, match);
1081  else if (object == MT_COLOR_ATTACH_HEADERS)
1082  rc = add_pattern(&ColorAttachList, buf->data, true, fg, bg, attr, err, false, match);
1083  else if ((object == MT_COLOR_STATUS) && MoreArgs(s))
1084  {
1085  /* 'color status fg bg' can have up to 2 arguments:
1086  * 0 arguments: sets the default status color (handled below by else part)
1087  * 1 argument : colorize pattern on match
1088  * 2 arguments: colorize nth submatch of pattern */
1089  mutt_extract_token(buf, s, 0);
1090 
1091  if (MoreArgs(s))
1092  {
1093  struct Buffer temporary = { 0 };
1094  mutt_extract_token(&temporary, s, 0);
1095  match = atoi(temporary.data);
1096  FREE(&temporary.data);
1097  }
1098 
1099  if (MoreArgs(s))
1100  {
1101  mutt_buffer_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
1102  return MUTT_CMD_WARNING;
1103  }
1104 
1105  rc = add_pattern(&ColorStatusList, buf->data, true, fg, bg, attr, err, false, match);
1106  }
1107  else if (object == MT_COLOR_INDEX)
1108  {
1109  rc = add_pattern(&ColorIndexList, buf->data, true, fg, bg, attr, err, true, match);
1111  }
1112  else if (object == MT_COLOR_INDEX_AUTHOR)
1113  {
1114  rc = add_pattern(&ColorIndexAuthorList, buf->data, true, fg, bg, attr, err, true, match);
1116  }
1117  else if (object == MT_COLOR_INDEX_FLAGS)
1118  {
1119  rc = add_pattern(&ColorIndexFlagsList, buf->data, true, fg, bg, attr, err, true, match);
1121  }
1122  else if (object == MT_COLOR_INDEX_SUBJECT)
1123  {
1124  rc = add_pattern(&ColorIndexSubjectList, buf->data, true, fg, bg, attr, err, true, match);
1126  }
1127  else if (object == MT_COLOR_INDEX_TAG)
1128  {
1129  rc = add_pattern(&ColorIndexTagList, buf->data, true, fg, bg, attr, err, true, match);
1131  }
1132  else if (object == MT_COLOR_QUOTED)
1133  {
1134  if (q_level >= ColorQuoteSize)
1135  {
1136  mutt_mem_realloc(&ColorQuote, (ColorQuoteSize += 2) * sizeof(int));
1139  }
1140  if (q_level >= ColorQuoteUsed)
1141  ColorQuoteUsed = q_level + 1;
1142  if (q_level == 0)
1143  {
1144  ColorDefs[MT_COLOR_QUOTED] = fgbgattr_to_color(fg, bg, attr);
1145 
1147  for (q_level = 1; q_level < ColorQuoteUsed; q_level++)
1148  {
1149  if (ColorQuote[q_level] == A_NORMAL)
1150  ColorQuote[q_level] = ColorDefs[MT_COLOR_QUOTED];
1151  }
1152  }
1153  else
1154  ColorQuote[q_level] = fgbgattr_to_color(fg, bg, attr);
1155  }
1156  else
1157  {
1158  ColorDefs[object] = fgbgattr_to_color(fg, bg, attr);
1159  if (object > MT_COLOR_INDEX_AUTHOR)
1161  }
1162 
1163  return rc;
1164 }
Index: subject field (takes a pattern)
Definition: mutt_curses.h:159
CommandResult
Error codes for command_t parse functions.
Definition: mutt_commands.h:31
static int parse_object(struct Buffer *buf, struct Buffer *s, int *o, int *ql, struct Buffer *err)
Parse a colour config line.
Definition: color.c:826
Error: Can&#39;t help the user.
Definition: mutt_commands.h:33
int * ColorQuote
Array of colours for quoted email text.
Definition: color.c:50
struct ColorLineHead ColorIndexFlagsList
List of colours applied to the flags in the index.
Definition: color.c:57
Pager: quoted text.
Definition: mutt_curses.h:125
static int ColorQuoteSize
Definition: color.c:64
struct ColorLineHead ColorBodyList
List of colours applied to the email body.
Definition: color.c:54
String manipulation buffer.
Definition: buffer.h:33
#define _(a)
Definition: message.h:28
Message headers (takes a pattern)
Definition: mutt_curses.h:135
int ColorQuoteUsed
Number of colours for quoted email text.
Definition: color.c:51
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:45
Index panel (list of emails)
Definition: keymap.h:74
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:200
int match
which substringmap 0 for old behaviour
Definition: mutt_curses.h:181
#define MoreArgs(buf)
Definition: buffer.h:44
Index: default colour (takes a pattern)
Definition: mutt_curses.h:155
struct ColorLineHead ColorIndexAuthorList
List of colours applied to the author in the index.
Definition: color.c:56
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:124
Index: tag field (g, takes a pattern)
Definition: mutt_curses.h:158
void mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:316
Index: flags field (takes a pattern)
Definition: mutt_curses.h:157
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:2659
char * dptr
current read/write position
Definition: buffer.h:36
Index: author field (takes a pattern)
Definition: mutt_curses.h:156
char * data
pointer to data
Definition: buffer.h:35
Pager: highlight body of message (takes a pattern)
Definition: mutt_curses.h:134
Index: tree-drawing characters.
Definition: mutt_curses.h:129
struct ColorLineHead ColorHdrList
List of colours applied to the email headers.
Definition: color.c:55
static int fgbgattr_to_color(int fg, int bg, int attr)
Convert a foreground, background, attribute triplet into a colour.
Definition: color.c:994
int ColorDefs[MT_COLOR_MAX]
Array of all fixed colours, see enum ColorId.
Definition: color.c:52
Success: Command worked.
Definition: mutt_commands.h:35
Warning: Help given to the user.
Definition: mutt_commands.h:34
short fg
Definition: mutt_curses.h:185
MIME attachment test (takes a pattern)
Definition: mutt_curses.h:138
struct ColorLineHead ColorIndexSubjectList
List of colours applied to the subject in the index.
Definition: color.c:59
struct ColorLineHead ColorIndexTagList
List of colours applied to tags in the index.
Definition: color.c:60
#define FREE(x)
Definition: memory.h:40
Status bar.
Definition: mutt_curses.h:128
short bg
Definition: mutt_curses.h:186
struct ColorLineHead ColorStatusList
List of colours applied to the status bar.
Definition: color.c:61
static enum CommandResult add_pattern(struct ColorLineHead *top, const char *s, bool sensitive, int fg, int bg, int attr, struct Buffer *err, bool is_index, int match)
Associate a colour to a pattern.
Definition: color.c:719
struct ColorLineHead ColorIndexList
List of default colours applied to the index.
Definition: color.c:58
struct ColorLineHead ColorAttachList
List of colours applied to the attachment headers.
Definition: color.c:53

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

enum CommandResult mutt_parse_mono ( struct Buffer buf,
struct Buffer s,
unsigned long  data,
struct Buffer err 
)

Parse the 'mono' command - Implements command_t.

Definition at line 1187 of file color.c.

1189 {
1190  bool dry_run = false;
1191 
1192 #ifdef HAVE_COLOR
1193  if (OptNoCurses || has_colors())
1194  dry_run = true;
1195 #else
1196  if (OptNoCurses)
1197  dry_run = true;
1198 #endif
1199 
1200  return parse_color(buf, s, err, parse_attr_spec, dry_run, false);
1201 }
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:45
static int parse_attr_spec(struct Buffer *buf, struct Buffer *s, int *fg, int *bg, int *attr, struct Buffer *err)
Parse an attribute description - Implements parser_callback_t.
Definition: color.c:950
static enum CommandResult parse_color(struct Buffer *buf, struct Buffer *s, struct Buffer *err, parser_callback_t callback, bool dry_run, bool color)
Parse a "color" command.
Definition: color.c:1017

+ Here is the call graph for this function:

static void mutt_free_color_list ( struct ColorLineHead *  head)
static

Free a list of colours.

Parameters
headColorLine List

Definition at line 1207 of file color.c.

1208 {
1209  struct ColorLine *np, *tmp;
1210  STAILQ_FOREACH_SAFE(np, head, entries, tmp)
1211  {
1212  STAILQ_REMOVE(head, np, ColorLine, entries);
1213  free_color_line(np, true);
1214  }
1215 }
#define STAILQ_REMOVE(head, elm, type, field)
Definition: queue.h:400
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
Definition: queue.h:360
static void free_color_line(struct ColorLine *tmp, bool free_colors)
Free a ColorLine.
Definition: color.c:175
A regular expression and a color to highlight a line.
Definition: mutt_curses.h:178

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void mutt_free_colors ( void  )

Free all the colours (on shutdown)

Definition at line 1220 of file color.c.

1221 {
1231 
1232  struct ColorList *cl = ColorList;
1233  struct ColorList *next = NULL;
1234  while (cl)
1235  {
1236  next = cl->next;
1237  FREE(&cl);
1238  cl = next;
1239  }
1240  ColorList = NULL;
1241 }
struct ColorLineHead ColorIndexFlagsList
List of colours applied to the flags in the index.
Definition: color.c:57
struct ColorLineHead ColorBodyList
List of colours applied to the email body.
Definition: color.c:54
struct ColorLineHead ColorIndexAuthorList
List of colours applied to the author in the index.
Definition: color.c:56
struct ColorLineHead ColorHdrList
List of colours applied to the email headers.
Definition: color.c:55
static void mutt_free_color_list(struct ColorLineHead *head)
Free a list of colours.
Definition: color.c:1207
struct ColorLineHead ColorIndexSubjectList
List of colours applied to the subject in the index.
Definition: color.c:59
struct ColorLineHead ColorIndexTagList
List of colours applied to tags in the index.
Definition: color.c:60
#define FREE(x)
Definition: memory.h:40
struct ColorLineHead ColorStatusList
List of colours applied to the status bar.
Definition: color.c:61
struct ColorLineHead ColorIndexList
List of default colours applied to the index.
Definition: color.c:58
struct ColorLineHead ColorAttachList
List of colours applied to the attachment headers.
Definition: color.c:53

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

int* ColorQuote = NULL

Array of colours for quoted email text.

Definition at line 50 of file color.c.

int ColorQuoteUsed

Number of colours for quoted email text.

Definition at line 51 of file color.c.

int ColorDefs[MT_COLOR_MAX]

Array of all fixed colours, see enum ColorId.

Definition at line 52 of file color.c.

struct ColorLineHead ColorAttachList = STAILQ_HEAD_INITIALIZER(ColorAttachList)

List of colours applied to the attachment headers.

Definition at line 53 of file color.c.

struct ColorLineHead ColorBodyList = STAILQ_HEAD_INITIALIZER(ColorBodyList)

List of colours applied to the email body.

Definition at line 54 of file color.c.

struct ColorLineHead ColorHdrList = STAILQ_HEAD_INITIALIZER(ColorHdrList)

List of colours applied to the email headers.

Definition at line 55 of file color.c.

struct ColorLineHead ColorIndexAuthorList = STAILQ_HEAD_INITIALIZER(ColorIndexAuthorList)

List of colours applied to the author in the index.

Definition at line 56 of file color.c.

struct ColorLineHead ColorIndexFlagsList = STAILQ_HEAD_INITIALIZER(ColorIndexFlagsList)

List of colours applied to the flags in the index.

Definition at line 57 of file color.c.

struct ColorLineHead ColorIndexList = STAILQ_HEAD_INITIALIZER(ColorIndexList)

List of default colours applied to the index.

Definition at line 58 of file color.c.

struct ColorLineHead ColorIndexSubjectList = STAILQ_HEAD_INITIALIZER(ColorIndexSubjectList)

List of colours applied to the subject in the index.

Definition at line 59 of file color.c.

struct ColorLineHead ColorIndexTagList = STAILQ_HEAD_INITIALIZER(ColorIndexTagList)

List of colours applied to tags in the index.

Definition at line 60 of file color.c.

struct ColorLineHead ColorStatusList = STAILQ_HEAD_INITIALIZER(ColorStatusList)

List of colours applied to the status bar.

Definition at line 61 of file color.c.

int ColorQuoteSize
static

Definition at line 64 of file color.c.

const struct Mapping Fields[]
static

Definition at line 102 of file color.c.

const struct Mapping ComposeFields[]
static
Initial value:
= {
{ "header", MT_COLOR_COMPOSE_HEADER },
{ "security_encrypt", MT_COLOR_COMPOSE_SECURITY_ENCRYPT },
{ "security_sign", MT_COLOR_COMPOSE_SECURITY_SIGN },
{ "security_both", MT_COLOR_COMPOSE_SECURITY_BOTH },
{ "security_none", MT_COLOR_COMPOSE_SECURITY_NONE },
{ NULL, 0 }
}
Header labels, e.g. From:
Definition: mutt_curses.h:167
Mail will not be encrypted or signed.
Definition: mutt_curses.h:171
Mail will be encrypted.
Definition: mutt_curses.h:168
Mail will be signed.
Definition: mutt_curses.h:169
Mail will be encrypted and signed.
Definition: mutt_curses.h:170

Definition at line 146 of file color.c.