NeoMutt  2018-07-16 +2225-8687db
Teaching an old dog new tricks
DOXYGEN
color.c File Reference

Color and attribute parsing. More...

#include "config.h"
#include <assert.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 "core/lib.h"
#include "globals.h"
#include "keymap.h"
#include "mutt_commands.h"
#include "mutt_curses.h"
#include "mutt_menu.h"
#include "options.h"
#include "pattern.h"

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, uint32_t *fg, uint32_t *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, uint32_t fg, uint32_t 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, uint32_t *o, uint32_t *ql, struct Buffer *err)
 Parse a colour config line. More...
 
static int parse_attr_spec (struct Buffer *buf, struct Buffer *s, uint32_t *fg, uint32_t *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 167 of file color.c.

Typedef Documentation

typedef int(* parser_callback_t) (struct Buffer *buf, struct Buffer *s, uint32_t *fg, uint32_t *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 929 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 173 of file color.c.

174 {
175  struct ColorLine *p = mutt_mem_calloc(1, sizeof(struct ColorLine));
176 
177  p->fg = COLOR_UNSET;
178  p->bg = COLOR_UNSET;
179 
180  return p;
181 }
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
uint32_t fg
Definition: mutt_curses.h:187
uint32_t bg
Definition: mutt_curses.h:188
A regular expression and a color to highlight a line.
Definition: mutt_curses.h:180
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 188 of file color.c.

189 {
190  if (!tmp)
191  return;
192 
193 #ifdef HAVE_COLOR
194  if (free_colors && (tmp->fg != COLOR_UNSET) && (tmp->bg != COLOR_UNSET))
195  mutt_free_color(tmp->fg, tmp->bg);
196 #endif
197 
198  /* we should really introduce a container type for regular expressions. */
199  regfree(&tmp->regex);
201  FREE(&tmp->pattern);
202  FREE(&tmp);
203 }
char * pattern
Definition: mutt_curses.h:184
void mutt_free_color(uint32_t fg, uint32_t bg)
uint32_t fg
Definition: mutt_curses.h:187
uint32_t bg
Definition: mutt_curses.h:188
regex_t regex
Definition: mutt_curses.h:182
#define FREE(x)
Definition: memory.h:40
struct PatternHead * color_pattern
compiled pattern to speed up index color calculation
Definition: mutt_curses.h:185
void mutt_pattern_free(struct PatternHead **pat)
Free a Pattern.
Definition: pattern.c:1337
void ci_start_color ( void  )

Set up the default colours.

Definition at line 208 of file color.c.

209 {
210  memset(ColorDefs, A_NORMAL, sizeof(int) * MT_COLOR_MAX);
212  memset(ColorQuote, A_NORMAL, sizeof(int) * COLOR_QUOTE_INIT);
214  ColorQuoteUsed = 0;
215 
216  /* set some defaults */
217  ColorDefs[MT_COLOR_STATUS] = A_REVERSE;
218  ColorDefs[MT_COLOR_INDICATOR] = A_REVERSE;
219  ColorDefs[MT_COLOR_SEARCH] = A_REVERSE;
220  ColorDefs[MT_COLOR_MARKERS] = A_REVERSE;
221 #ifdef USE_SIDEBAR
222  ColorDefs[MT_COLOR_HIGHLIGHT] = A_UNDERLINE;
223 #endif
224  /* special meaning: toggle the relevant attribute */
227 
228 #ifdef HAVE_COLOR
229  start_color();
230 #endif
231 }
int * ColorQuote
Array of colours for quoted email text.
Definition: color.c:51
Bold text.
Definition: mutt_curses.h:141
static int ColorQuoteSize
Definition: color.c:65
int ColorQuoteUsed
Number of colours for quoted email text.
Definition: color.c:52
Pager: search matches.
Definition: mutt_curses.h:140
Pager: markers, line continuation.
Definition: mutt_curses.h:134
Underlined text.
Definition: mutt_curses.h:142
Select cursor.
Definition: mutt_curses.h:148
void * mutt_mem_malloc(size_t size)
Allocate memory on the heap.
Definition: memory.c:90
#define COLOR_QUOTE_INIT
Definition: color.c:167
int ColorDefs[MT_COLOR_MAX]
Array of all fixed colours, see enum ColorId.
Definition: color.c:53
Status bar.
Definition: mutt_curses.h:129
Selected item in list.
Definition: mutt_curses.h:128
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 572 of file color.c.

574 {
575  struct ColorLine *np = NULL, *tmp = NULL;
576  do
577  {
579  if (mutt_str_strcmp("*", buf->data) == 0)
580  {
581  np = STAILQ_FIRST(cl);
582  while (np)
583  {
584  tmp = STAILQ_NEXT(np, entries);
585  if (!*do_cache)
586  {
587  *do_cache = true;
588  }
590  np = tmp;
591  }
592  STAILQ_INIT(cl);
593  return;
594  }
595  else
596  {
597  tmp = NULL;
598  STAILQ_FOREACH(np, cl, entries)
599  {
600  if (mutt_str_strcmp(buf->data, np->pattern) == 0)
601  {
602  if (!*do_cache)
603  {
604  *do_cache = true;
605  }
606  mutt_debug(LL_DEBUG1, "Freeing pattern \"%s\" from ColorList\n", buf->data);
607  if (tmp)
608  STAILQ_REMOVE_AFTER(cl, tmp, entries);
609  else
610  STAILQ_REMOVE_HEAD(cl, entries);
612  break;
613  }
614  tmp = np;
615  }
616  }
617  } while (MoreArgs(s));
618 }
char * pattern
Definition: mutt_curses.h:184
#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:633
static void free_color_line(struct ColorLine *tmp, bool free_colors)
Free a ColorLine.
Definition: color.c:188
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:2614
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:81
#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:615
A regular expression and a color to highlight a line.
Definition: mutt_curses.h:180
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
Definition: mutt.h:76
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
CommandResultResult e.g. MUTT_CMD_SUCCESS

usage:

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

Definition at line 633 of file color.c.

635 {
636  int object = 0;
637  bool do_cache = false;
638 
640 
641  object = mutt_map_get_value(buf->data, Fields);
642  if (object == -1)
643  {
644  mutt_buffer_printf(err, _("%s: no such object"), buf->data);
645  return MUTT_CMD_ERROR;
646  }
647 
648  if (object > MT_COLOR_INDEX_SUBJECT)
649  { /* uncolor index column */
650  ColorDefs[object] = 0;
652  return MUTT_CMD_SUCCESS;
653  }
654 
655  if (!mutt_str_startswith(buf->data, "body", CASE_MATCH) &&
656  !mutt_str_startswith(buf->data, "header", CASE_MATCH) &&
657  !mutt_str_startswith(buf->data, "index", CASE_MATCH))
658  {
659  mutt_buffer_printf(err, _("%s: command valid only for index, body, header objects"),
660  parse_uncolor ? "uncolor" : "unmono");
661  return MUTT_CMD_WARNING;
662  }
663 
664  if (!MoreArgs(s))
665  {
666  mutt_buffer_printf(err, _("%s: too few arguments"), parse_uncolor ? "uncolor" : "unmono");
667  return MUTT_CMD_WARNING;
668  }
669 
670  if (
671 #ifdef HAVE_COLOR
672  /* we're running without curses */
673  OptNoCurses || /* we're parsing an uncolor command, and have no colors */
674  (parse_uncolor && !has_colors())
675  /* we're parsing an unmono command, and have colors */
676  || (!parse_uncolor && has_colors())
677 #else
678  /* We don't even have colors compiled in */
680 #endif
681  )
682  {
683  /* just eat the command, but don't do anything real about it */
684  do
686  while (MoreArgs(s));
687 
688  return MUTT_CMD_SUCCESS;
689  }
690 
691  if (object == MT_COLOR_BODY)
692  do_uncolor(buf, s, &ColorBodyList, &do_cache, parse_uncolor);
693  else if (object == MT_COLOR_HEADER)
694  do_uncolor(buf, s, &ColorHdrList, &do_cache, parse_uncolor);
695  else if (object == MT_COLOR_ATTACH_HEADERS)
696  do_uncolor(buf, s, &ColorAttachList, &do_cache, parse_uncolor);
697  else if (object == MT_COLOR_INDEX)
698  do_uncolor(buf, s, &ColorIndexList, &do_cache, parse_uncolor);
699  else if (object == MT_COLOR_INDEX_AUTHOR)
700  do_uncolor(buf, s, &ColorIndexAuthorList, &do_cache, parse_uncolor);
701  else if (object == MT_COLOR_INDEX_FLAGS)
702  do_uncolor(buf, s, &ColorIndexFlagsList, &do_cache, parse_uncolor);
703  else if (object == MT_COLOR_INDEX_SUBJECT)
704  do_uncolor(buf, s, &ColorIndexSubjectList, &do_cache, parse_uncolor);
705  else if (object == MT_COLOR_INDEX_TAG)
706  do_uncolor(buf, s, &ColorIndexTagList, &do_cache, parse_uncolor);
707 
708  bool is_index = ((object == MT_COLOR_INDEX) || (object == MT_COLOR_INDEX_AUTHOR) ||
709  (object == MT_COLOR_INDEX_FLAGS) || (object == MT_COLOR_INDEX_SUBJECT) ||
710  (object == MT_COLOR_INDEX_TAG));
711 
712  if (is_index && do_cache && !OptNoCurses)
713  {
715  /* force re-caching of index colors */
716  for (int i = 0; Context && i < Context->mailbox->msg_count; i++)
717  Context->mailbox->emails[i]->pair = 0;
718  }
719  return MUTT_CMD_SUCCESS;
720 }
struct Email ** emails
Array of Emails.
Definition: mailbox.h:111
Index: subject field (takes a pattern)
Definition: mutt_curses.h:160
The "current" mailbox.
Definition: context.h:39
int msg_count
Total number of messages.
Definition: mailbox.h:103
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:58
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:572
struct ColorLineHead ColorBodyList
List of colours applied to the email body.
Definition: color.c:55
#define _(a)
Definition: message.h:28
Message headers (takes a pattern)
Definition: mutt_curses.h:136
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:45
Match case when comparing strings.
Definition: string2.h:67
Index panel (list of emails)
Definition: keymap.h:76
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:191
#define MoreArgs(buf)
Definition: buffer.h:44
struct Mailbox * mailbox
Definition: context.h:53
Index: default colour (takes a pattern)
Definition: mutt_curses.h:156
struct ColorLineHead ColorIndexAuthorList
List of colours applied to the author in the index.
Definition: color.c:57
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:633
Index: tag field (g, takes a pattern)
Definition: mutt_curses.h:159
Index: flags field (takes a pattern)
Definition: mutt_curses.h:158
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:2614
Index: author field (takes a pattern)
Definition: mutt_curses.h:157
char * data
Pointer to data.
Definition: buffer.h:35
Pager: highlight body of message (takes a pattern)
Definition: mutt_curses.h:135
struct ColorLineHead ColorHdrList
List of colours applied to the email headers.
Definition: color.c:56
int ColorDefs[MT_COLOR_MAX]
Array of all fixed colours, see enum ColorId.
Definition: color.c:53
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:168
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:139
struct ColorLineHead ColorIndexSubjectList
List of colours applied to the subject in the index.
Definition: color.c:60
struct ColorLineHead ColorIndexTagList
List of colours applied to tags in the index.
Definition: color.c:61
struct ColorLineHead ColorIndexList
List of default colours applied to the index.
Definition: color.c:59
int pair
Color-pair to use when displaying in the index.
Definition: email.h:79
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
Definition: mutt.h:76
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:113
struct ColorLineHead ColorAttachList
List of colours applied to the attachment headers.
Definition: color.c:54
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 738 of file color.c.

740 {
741  return parse_uncolor(buf, s, data, err, false);
742 }
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:633
static enum CommandResult add_pattern ( struct ColorLineHead *  top,
const char *  s,
bool  sensitive,
uint32_t  fg,
uint32_t  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
CommandResultResult e.g. MUTT_CMD_SUCCESS

Definition at line 757 of file color.c.

760 {
761  /* is_index used to store compiled pattern
762  * only for 'index' color object
763  * when called from mutt_parse_color() */
764 
765  struct ColorLine *tmp = NULL;
766 
767  STAILQ_FOREACH(tmp, top, entries)
768  {
769  if (sensitive)
770  {
771  if (mutt_str_strcmp(s, tmp->pattern) == 0)
772  break;
773  }
774  else
775  {
776  if (mutt_str_strcasecmp(s, tmp->pattern) == 0)
777  break;
778  }
779  }
780 
781  if (tmp)
782  {
783 #ifdef HAVE_COLOR
784  if ((fg != COLOR_UNSET) && (bg != COLOR_UNSET))
785  {
786  if ((tmp->fg != fg) || (tmp->bg != bg))
787  {
788  mutt_free_color(tmp->fg, tmp->bg);
789  tmp->fg = fg;
790  tmp->bg = bg;
791  attr |= mutt_alloc_color(fg, bg);
792  }
793  else
794  attr |= (tmp->pair & ~A_BOLD);
795  }
796 #endif /* HAVE_COLOR */
797  tmp->pair = attr;
798  }
799  else
800  {
801  tmp = new_color_line();
802  if (is_index)
803  {
804  struct Buffer *buf = mutt_buffer_pool_get();
805  mutt_buffer_strcpy(buf, s);
809  if (!tmp->color_pattern)
810  {
811  free_color_line(tmp, true);
812  return MUTT_CMD_ERROR;
813  }
814  }
815  else
816  {
817  int flags = 0;
818  if (sensitive)
819  flags = mutt_mb_is_lower(s) ? REG_ICASE : 0;
820  else
821  flags = REG_ICASE;
822 
823  const int r = REG_COMP(&tmp->regex, s, flags);
824  if (r != 0)
825  {
826  regerror(r, &tmp->regex, err->data, err->dsize);
827  free_color_line(tmp, true);
828  return MUTT_CMD_ERROR;
829  }
830  }
831  tmp->pattern = mutt_str_strdup(s);
832  tmp->match = match;
833 #ifdef HAVE_COLOR
834  if ((fg != COLOR_UNSET) && (bg != COLOR_UNSET))
835  {
836  tmp->fg = fg;
837  tmp->bg = bg;
838  attr |= mutt_alloc_color(fg, bg);
839  }
840 #endif
841  tmp->pair = attr;
842  STAILQ_INSERT_HEAD(top, tmp, entries);
843  }
844 
845  /* force re-caching of index colors */
846  if (is_index)
847  {
848  for (int i = 0; Context && i < Context->mailbox->msg_count; i++)
849  Context->mailbox->emails[i]->pair = 0;
850  }
851 
852  return MUTT_CMD_SUCCESS;
853 }
struct Email ** emails
Array of Emails.
Definition: mailbox.h:111
The "current" mailbox.
Definition: context.h:39
#define NONULL(x)
Definition: string2.h:37
int msg_count
Total number of messages.
Definition: mailbox.h:103
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:75
Error: Can&#39;t help the user.
Definition: mutt_commands.h:33
void mutt_check_simple(struct Buffer *buf, const char *simple)
Convert a simple search into a real request.
Definition: pattern.c:2300
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
Definition: pool.c:86
#define MUTT_FULL_MSG
enable body and header matching
Definition: pattern.h:41
struct PatternHead * mutt_pattern_comp(const char *s, int flags, struct Buffer *err)
Create a Pattern.
Definition: pattern.c:1389
char * pattern
Definition: mutt_curses.h:184
String manipulation buffer.
Definition: buffer.h:33
void mutt_free_color(uint32_t fg, uint32_t bg)
int match
which substringmap 0 for old behaviour
Definition: mutt_curses.h:183
size_t dsize
Length of data.
Definition: buffer.h:37
struct Mailbox * mailbox
Definition: context.h:53
#define REG_COMP(preg, regex, cflags)
Compile a regular expression.
Definition: regex3.h:52
static struct ColorLine * new_color_line(void)
Create a new ColorLine.
Definition: color.c:173
uint32_t fg
Definition: mutt_curses.h:187
void mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:314
static void free_color_line(struct ColorLine *tmp, bool free_colors)
Free a ColorLine.
Definition: color.c:188
uint32_t bg
Definition: mutt_curses.h:188
char * data
Pointer to data.
Definition: buffer.h:35
#define STAILQ_INSERT_HEAD(head, elm, field)
Definition: queue.h:381
#define STAILQ_FOREACH(var, head, field)
Definition: queue.h:350
WHERE char * C_SimpleSearch
Config: Pattern to search for when search doesn&#39;t contain ~&#39;s.
Definition: globals.h:138
regex_t regex
Definition: mutt_curses.h:182
Success: Command worked.
Definition: mutt_commands.h:35
char * mutt_str_strdup(const char *str)
Copy a string, safely.
Definition: string.c:380
int mutt_str_strcasecmp(const char *a, const char *b)
Compare two strings ignoring case, safely.
Definition: string.c:628
int mutt_alloc_color(uint32_t fg, uint32_t bg)
bool mutt_mb_is_lower(const char *s)
Does a multi-byte string contain only lowercase characters?
Definition: mbyte.c:358
int mutt_str_strcmp(const char *a, const char *b)
Compare two strings, safely.
Definition: string.c:615
int pair
Color-pair to use when displaying in the index.
Definition: email.h:79
A regular expression and a color to highlight a line.
Definition: mutt_curses.h:180
struct PatternHead * color_pattern
compiled pattern to speed up index color calculation
Definition: mutt_curses.h:185
static int parse_object ( struct Buffer buf,
struct Buffer s,
uint32_t *  o,
uint32_t *  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 865 of file color.c.

867 {
868  if (!MoreArgs(s))
869  {
870  mutt_buffer_printf(err, _("%s: too few arguments"), "color");
871  return -1;
872  }
873 
875  if (mutt_str_startswith(buf->data, "quoted", CASE_MATCH))
876  {
877  if (buf->data[6])
878  {
879  char *eptr = NULL;
880  *ql = strtoul(buf->data + 6, &eptr, 10);
881  if (*eptr || (*ql == COLOR_UNSET))
882  {
883  mutt_buffer_printf(err, _("%s: no such object"), buf->data);
884  return -1;
885  }
886  }
887  else
888  *ql = 0;
889 
890  *o = MT_COLOR_QUOTED;
891  }
892  else if (mutt_str_strcasecmp(buf->data, "compose") == 0)
893  {
894  if (!MoreArgs(s))
895  {
896  mutt_buffer_printf(err, _("%s: too few arguments"), "color");
897  return -1;
898  }
899 
901 
903  if (*o == -1)
904  {
905  mutt_buffer_printf(err, _("%s: no such object"), buf->data);
906  return -1;
907  }
908  }
909  else if ((*o = mutt_map_get_value(buf->data, Fields)) == -1)
910  {
911  mutt_buffer_printf(err, _("%s: no such object"), buf->data);
912  return -1;
913  }
914 
915  return 0;
916 }
static const struct Mapping ComposeFields[]
Definition: color.c:158
Pager: quoted text.
Definition: mutt_curses.h:126
#define _(a)
Definition: message.h:28
Match case when comparing strings.
Definition: string2.h:67
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:191
#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:2614
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:168
int mutt_str_strcasecmp(const char *a, const char *b)
Compare two strings ignoring case, safely.
Definition: string.c:628
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
Definition: mutt.h:76
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:113
static int parse_attr_spec ( struct Buffer buf,
struct Buffer s,
uint32_t *  fg,
uint32_t *  bg,
int *  attr,
struct Buffer err 
)
static

Parse an attribute description - Implements parser_callback_t.

Definition at line 989 of file color.c.

991 {
992  if (fg)
993  *fg = COLOR_UNSET;
994  if (bg)
995  *bg = COLOR_UNSET;
996 
997  if (!MoreArgs(s))
998  {
999  mutt_buffer_printf(err, _("%s: too few arguments"), "mono");
1000  return -1;
1001  }
1002 
1004 
1005  if (mutt_str_strcasecmp("bold", buf->data) == 0)
1006  *attr |= A_BOLD;
1007  else if (mutt_str_strcasecmp("underline", buf->data) == 0)
1008  *attr |= A_UNDERLINE;
1009  else if (mutt_str_strcasecmp("none", buf->data) == 0)
1010  *attr = A_NORMAL;
1011  else if (mutt_str_strcasecmp("reverse", buf->data) == 0)
1012  *attr |= A_REVERSE;
1013  else if (mutt_str_strcasecmp("standout", buf->data) == 0)
1014  *attr |= A_STANDOUT;
1015  else if (mutt_str_strcasecmp("normal", buf->data) == 0)
1016  *attr = A_NORMAL; /* needs use = instead of |= to clear other bits */
1017  else
1018  {
1019  mutt_buffer_printf(err, _("%s: no such attribute"), buf->data);
1020  return -1;
1021  }
1022 
1023  return 0;
1024 }
#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:191
#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:2614
char * data
Pointer to data.
Definition: buffer.h:35
int mutt_str_strcasecmp(const char *a, const char *b)
Compare two strings ignoring case, safely.
Definition: string.c:628
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
Definition: mutt.h:76
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 1033 of file color.c.

1034 {
1035 #ifdef HAVE_COLOR
1036  if ((fg != COLOR_UNSET) && (bg != COLOR_UNSET))
1037  return attr | mutt_alloc_color(fg, bg);
1038  else
1039 #endif
1040  return attr;
1041 }
int mutt_alloc_color(uint32_t fg, uint32_t bg)
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
CommandResultResult e.g. MUTT_CMD_SUCCESS

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

Definition at line 1056 of file color.c.

1059 {
1060  int attr = 0;
1061  uint32_t fg = 0, bg = 0, object = 0, q_level = 0, match = 0;
1062  enum CommandResult rc = MUTT_CMD_SUCCESS;
1063 
1064  if (parse_object(buf, s, &object, &q_level, err) == -1)
1065  return MUTT_CMD_ERROR;
1066 
1067  if (callback(buf, s, &fg, &bg, &attr, err) == -1)
1068  return MUTT_CMD_ERROR;
1069 
1070  /* extract a regular expression if needed */
1071 
1072  if ((object == MT_COLOR_BODY) || (object == MT_COLOR_HEADER) ||
1073  (object == MT_COLOR_ATTACH_HEADERS) || (object == MT_COLOR_INDEX) ||
1074  (object == MT_COLOR_INDEX_AUTHOR) || (object == MT_COLOR_INDEX_FLAGS) ||
1075  (object == MT_COLOR_INDEX_TAG) || (object == MT_COLOR_INDEX_SUBJECT))
1076  {
1077  if (!MoreArgs(s))
1078  {
1079  mutt_buffer_printf(err, _("%s: too few arguments"), color ? "color" : "mono");
1080  return MUTT_CMD_WARNING;
1081  }
1082 
1084  }
1085 
1086  if (MoreArgs(s) && (object != MT_COLOR_STATUS))
1087  {
1088  mutt_buffer_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
1089  return MUTT_CMD_WARNING;
1090  }
1091 
1092  /* dry run? */
1093 
1094  if (dry_run)
1095  {
1096  *s->dptr = '\0'; /* fake that we're done parsing */
1097  return MUTT_CMD_SUCCESS;
1098  }
1099 
1100 #ifdef HAVE_COLOR
1101 #ifdef HAVE_USE_DEFAULT_COLORS
1102  if (!OptNoCurses &&
1103  has_colors()
1104  /* delay use_default_colors() until needed, since it initializes things */
1105  && ((fg == COLOR_DEFAULT) || (bg == COLOR_DEFAULT) || (object == MT_COLOR_TREE)) &&
1106  (use_default_colors() != OK))
1107  /* the case of the tree object is special, because a non-default fg color of
1108  * the tree element may be combined dynamically with the default bg color of
1109  * an index line, not necessarily defined in a rc file. */
1110  {
1111  mutt_buffer_strcpy(err, _("default colors not supported"));
1112  return MUTT_CMD_ERROR;
1113  }
1114 #endif /* HAVE_USE_DEFAULT_COLORS */
1115 #endif
1116 
1117  if (object == MT_COLOR_HEADER)
1118  rc = add_pattern(&ColorHdrList, buf->data, false, fg, bg, attr, err, false, match);
1119  else if (object == MT_COLOR_BODY)
1120  rc = add_pattern(&ColorBodyList, buf->data, true, fg, bg, attr, err, false, match);
1121  else if (object == MT_COLOR_ATTACH_HEADERS)
1122  rc = add_pattern(&ColorAttachList, buf->data, true, fg, bg, attr, err, false, match);
1123  else if ((object == MT_COLOR_STATUS) && MoreArgs(s))
1124  {
1125  /* 'color status fg bg' can have up to 2 arguments:
1126  * 0 arguments: sets the default status color (handled below by else part)
1127  * 1 argument : colorize pattern on match
1128  * 2 arguments: colorize nth submatch of pattern */
1130 
1131  if (MoreArgs(s))
1132  {
1133  struct Buffer temporary = { 0 };
1134  mutt_extract_token(&temporary, s, MUTT_TOKEN_NO_FLAGS);
1135  mutt_str_atoui(temporary.data, &match);
1136  FREE(&temporary.data);
1137  }
1138 
1139  if (MoreArgs(s))
1140  {
1141  mutt_buffer_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
1142  return MUTT_CMD_WARNING;
1143  }
1144 
1145  rc = add_pattern(&ColorStatusList, buf->data, true, fg, bg, attr, err, false, match);
1146  }
1147  else if (object == MT_COLOR_INDEX)
1148  {
1149  rc = add_pattern(&ColorIndexList, buf->data, true, fg, bg, attr, err, true, match);
1151  }
1152  else if (object == MT_COLOR_INDEX_AUTHOR)
1153  {
1154  rc = add_pattern(&ColorIndexAuthorList, buf->data, true, fg, bg, attr, err, true, match);
1156  }
1157  else if (object == MT_COLOR_INDEX_FLAGS)
1158  {
1159  rc = add_pattern(&ColorIndexFlagsList, buf->data, true, fg, bg, attr, err, true, match);
1161  }
1162  else if (object == MT_COLOR_INDEX_SUBJECT)
1163  {
1164  rc = add_pattern(&ColorIndexSubjectList, buf->data, true, fg, bg, attr, err, true, match);
1166  }
1167  else if (object == MT_COLOR_INDEX_TAG)
1168  {
1169  rc = add_pattern(&ColorIndexTagList, buf->data, true, fg, bg, attr, err, true, match);
1171  }
1172  else if (object == MT_COLOR_QUOTED)
1173  {
1174  if (q_level >= ColorQuoteSize)
1175  {
1176  mutt_mem_realloc(&ColorQuote, (ColorQuoteSize += 2) * sizeof(int));
1179  }
1180  if (q_level >= ColorQuoteUsed)
1181  ColorQuoteUsed = q_level + 1;
1182  if (q_level == 0)
1183  {
1184  ColorDefs[MT_COLOR_QUOTED] = fgbgattr_to_color(fg, bg, attr);
1185 
1187  for (q_level = 1; q_level < ColorQuoteUsed; q_level++)
1188  {
1189  if (ColorQuote[q_level] == A_NORMAL)
1190  ColorQuote[q_level] = ColorDefs[MT_COLOR_QUOTED];
1191  }
1192  }
1193  else
1194  ColorQuote[q_level] = fgbgattr_to_color(fg, bg, attr);
1195  }
1196  else
1197  {
1198  ColorDefs[object] = fgbgattr_to_color(fg, bg, attr);
1199  if (object > MT_COLOR_INDEX_AUTHOR)
1201  }
1202 
1203  return rc;
1204 }
Index: subject field (takes a pattern)
Definition: mutt_curses.h:160
CommandResult
Error codes for command_t parse functions.
Definition: mutt_commands.h:31
Error: Can&#39;t help the user.
Definition: mutt_commands.h:33
int * ColorQuote
Array of colours for quoted email text.
Definition: color.c:51
static int parse_object(struct Buffer *buf, struct Buffer *s, uint32_t *o, uint32_t *ql, struct Buffer *err)
Parse a colour config line.
Definition: color.c:865
struct ColorLineHead ColorIndexFlagsList
List of colours applied to the flags in the index.
Definition: color.c:58
Pager: quoted text.
Definition: mutt_curses.h:126
static int ColorQuoteSize
Definition: color.c:65
struct ColorLineHead ColorBodyList
List of colours applied to the email body.
Definition: color.c:55
String manipulation buffer.
Definition: buffer.h:33
#define _(a)
Definition: message.h:28
Message headers (takes a pattern)
Definition: mutt_curses.h:136
int ColorQuoteUsed
Number of colours for quoted email text.
Definition: color.c:52
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:45
Index panel (list of emails)
Definition: keymap.h:76
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:191
#define MoreArgs(buf)
Definition: buffer.h:44
Index: default colour (takes a pattern)
Definition: mutt_curses.h:156
struct ColorLineHead ColorIndexAuthorList
List of colours applied to the author in the index.
Definition: color.c:57
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:114
Index: tag field (g, takes a pattern)
Definition: mutt_curses.h:159
void mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:314
Index: flags field (takes a pattern)
Definition: mutt_curses.h:158
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:2614
char * dptr
Current read/write position.
Definition: buffer.h:36
Index: author field (takes a pattern)
Definition: mutt_curses.h:157
char * data
Pointer to data.
Definition: buffer.h:35
Pager: highlight body of message (takes a pattern)
Definition: mutt_curses.h:135
Index: tree-drawing characters.
Definition: mutt_curses.h:130
struct ColorLineHead ColorHdrList
List of colours applied to the email headers.
Definition: color.c:56
int mutt_str_atoui(const char *str, unsigned int *dst)
Convert ASCII string to an unsigned integer.
Definition: string.c:292
static int fgbgattr_to_color(int fg, int bg, int attr)
Convert a foreground, background, attribute triplet into a colour.
Definition: color.c:1033
int ColorDefs[MT_COLOR_MAX]
Array of all fixed colours, see enum ColorId.
Definition: color.c:53
static enum CommandResult add_pattern(struct ColorLineHead *top, const char *s, bool sensitive, uint32_t fg, uint32_t bg, int attr, struct Buffer *err, bool is_index, int match)
Associate a colour to a pattern.
Definition: color.c:757
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:139
struct ColorLineHead ColorIndexSubjectList
List of colours applied to the subject in the index.
Definition: color.c:60
struct ColorLineHead ColorIndexTagList
List of colours applied to tags in the index.
Definition: color.c:61
#define FREE(x)
Definition: memory.h:40
Status bar.
Definition: mutt_curses.h:129
struct ColorLineHead ColorStatusList
List of colours applied to the status bar.
Definition: color.c:62
struct ColorLineHead ColorIndexList
List of default colours applied to the index.
Definition: color.c:59
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
Definition: mutt.h:76
struct ColorLineHead ColorAttachList
List of colours applied to the attachment headers.
Definition: color.c:54
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 1227 of file color.c.

1229 {
1230  bool dry_run = false;
1231 
1232 #ifdef HAVE_COLOR
1233  if (OptNoCurses || has_colors())
1234  dry_run = true;
1235 #else
1236  if (OptNoCurses)
1237  dry_run = true;
1238 #endif
1239 
1240  return parse_color(buf, s, err, parse_attr_spec, dry_run, false);
1241 }
static int parse_attr_spec(struct Buffer *buf, struct Buffer *s, uint32_t *fg, uint32_t *bg, int *attr, struct Buffer *err)
Parse an attribute description - Implements parser_callback_t.
Definition: color.c:989
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:45
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:1056
static void mutt_free_color_list ( struct ColorLineHead *  head)
static

Free a list of colours.

Parameters
headColorLine List

Definition at line 1247 of file color.c.

1248 {
1249  struct ColorLine *np = NULL, *tmp = NULL;
1250  STAILQ_FOREACH_SAFE(np, head, entries, tmp)
1251  {
1252  STAILQ_REMOVE(head, np, ColorLine, entries);
1253  free_color_line(np, true);
1254  }
1255 }
#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:188
A regular expression and a color to highlight a line.
Definition: mutt_curses.h:180
void mutt_free_colors ( void  )

Free all the colours (on shutdown)

Definition at line 1260 of file color.c.

1261 {
1271 
1272  struct ColorList *cl = ColorList;
1273  struct ColorList *next = NULL;
1274  while (cl)
1275  {
1276  next = cl->next;
1277  FREE(&cl);
1278  cl = next;
1279  }
1280  ColorList = NULL;
1281 }
struct ColorLineHead ColorIndexFlagsList
List of colours applied to the flags in the index.
Definition: color.c:58
struct ColorLineHead ColorBodyList
List of colours applied to the email body.
Definition: color.c:55
struct ColorLineHead ColorIndexAuthorList
List of colours applied to the author in the index.
Definition: color.c:57
struct ColorLineHead ColorHdrList
List of colours applied to the email headers.
Definition: color.c:56
static void mutt_free_color_list(struct ColorLineHead *head)
Free a list of colours.
Definition: color.c:1247
struct ColorLineHead ColorIndexSubjectList
List of colours applied to the subject in the index.
Definition: color.c:60
struct ColorLineHead ColorIndexTagList
List of colours applied to tags in the index.
Definition: color.c:61
#define FREE(x)
Definition: memory.h:40
struct ColorLineHead ColorStatusList
List of colours applied to the status bar.
Definition: color.c:62
struct ColorLineHead ColorIndexList
List of default colours applied to the index.
Definition: color.c:59
struct ColorLineHead ColorAttachList
List of colours applied to the attachment headers.
Definition: color.c:54

Variable Documentation

int* ColorQuote = NULL

Array of colours for quoted email text.

Definition at line 51 of file color.c.

int ColorQuoteUsed

Number of colours for quoted email text.

Definition at line 52 of file color.c.

int ColorDefs[MT_COLOR_MAX]

Array of all fixed colours, see enum ColorId.

Definition at line 53 of file color.c.

struct ColorLineHead ColorAttachList = STAILQ_HEAD_INITIALIZER(ColorAttachList)

List of colours applied to the attachment headers.

Definition at line 54 of file color.c.

struct ColorLineHead ColorBodyList = STAILQ_HEAD_INITIALIZER(ColorBodyList)

List of colours applied to the email body.

Definition at line 55 of file color.c.

struct ColorLineHead ColorHdrList = STAILQ_HEAD_INITIALIZER(ColorHdrList)

List of colours applied to the email headers.

Definition at line 56 of file color.c.

struct ColorLineHead ColorIndexAuthorList = STAILQ_HEAD_INITIALIZER(ColorIndexAuthorList)

List of colours applied to the author in the index.

Definition at line 57 of file color.c.

struct ColorLineHead ColorIndexFlagsList = STAILQ_HEAD_INITIALIZER(ColorIndexFlagsList)

List of colours applied to the flags in the index.

Definition at line 58 of file color.c.

struct ColorLineHead ColorIndexList = STAILQ_HEAD_INITIALIZER(ColorIndexList)

List of default colours applied to the index.

Definition at line 59 of file color.c.

struct ColorLineHead ColorIndexSubjectList = STAILQ_HEAD_INITIALIZER(ColorIndexSubjectList)

List of colours applied to the subject in the index.

Definition at line 60 of file color.c.

struct ColorLineHead ColorIndexTagList = STAILQ_HEAD_INITIALIZER(ColorIndexTagList)

List of colours applied to tags in the index.

Definition at line 61 of file color.c.

struct ColorLineHead ColorStatusList = STAILQ_HEAD_INITIALIZER(ColorStatusList)

List of colours applied to the status bar.

Definition at line 62 of file color.c.

int ColorQuoteSize
static

Definition at line 65 of file color.c.

const struct Mapping Fields[]
static

Definition at line 113 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:168
Mail will not be encrypted or signed.
Definition: mutt_curses.h:172
Mail will be encrypted.
Definition: mutt_curses.h:169
Mail will be signed.
Definition: mutt_curses.h:170
Mail will be encrypted and signed.
Definition: mutt_curses.h:171

Definition at line 158 of file color.c.