NeoMutt  2018-07-16 +2388-bcedc8
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 "core/lib.h"
#include "mutt.h"
#include "color.h"
#include "context.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"
+ 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, 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 169 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 931 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 175 of file color.c.

176 {
177  struct ColorLine *p = mutt_mem_calloc(1, sizeof(struct ColorLine));
178 
179  p->fg = COLOR_UNSET;
180  p->bg = COLOR_UNSET;
181 
182  return p;
183 }
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

+ 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 190 of file color.c.

191 {
192  if (!tmp)
193  return;
194 
195 #ifdef HAVE_COLOR
196  if (free_colors && (tmp->fg != COLOR_UNSET) && (tmp->bg != COLOR_UNSET))
197  mutt_free_color(tmp->fg, tmp->bg);
198 #endif
199 
200  /* we should really introduce a container type for regular expressions. */
201  regfree(&tmp->regex);
203  FREE(&tmp->pattern);
204  FREE(&tmp);
205 }
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:1334

+ 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 210 of file color.c.

211 {
212  memset(ColorDefs, A_NORMAL, sizeof(int) * MT_COLOR_MAX);
214  memset(ColorQuote, A_NORMAL, sizeof(int) * COLOR_QUOTE_INIT);
216  ColorQuoteUsed = 0;
217 
218  /* set some defaults */
219  ColorDefs[MT_COLOR_STATUS] = A_REVERSE;
220  ColorDefs[MT_COLOR_INDICATOR] = A_REVERSE;
221  ColorDefs[MT_COLOR_SEARCH] = A_REVERSE;
222  ColorDefs[MT_COLOR_MARKERS] = A_REVERSE;
223 #ifdef USE_SIDEBAR
224  ColorDefs[MT_COLOR_HIGHLIGHT] = A_UNDERLINE;
225 #endif
226  /* special meaning: toggle the relevant attribute */
229 
230 #ifdef HAVE_COLOR
231  start_color();
232 #endif
233 }
int * ColorQuote
Array of colours for quoted email text.
Definition: color.c:53
Bold text.
Definition: mutt_curses.h:141
static int ColorQuoteSize
Definition: color.c:67
int ColorQuoteUsed
Number of colours for quoted email text.
Definition: color.c:54
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:169
int ColorDefs[MT_COLOR_MAX]
Array of all fixed colours, see enum ColorId.
Definition: color.c:55
Status bar.
Definition: mutt_curses.h:129
Selected item in list.
Definition: mutt_curses.h:128

+ 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 574 of file color.c.

576 {
577  struct ColorLine *np = NULL, *tmp = NULL;
578  do
579  {
581  if (mutt_str_strcmp("*", buf->data) == 0)
582  {
583  np = STAILQ_FIRST(cl);
584  while (np)
585  {
586  tmp = STAILQ_NEXT(np, entries);
587  if (!*do_cache)
588  {
589  *do_cache = true;
590  }
592  np = tmp;
593  }
594  STAILQ_INIT(cl);
595  return;
596  }
597  else
598  {
599  tmp = NULL;
600  STAILQ_FOREACH(np, cl, entries)
601  {
602  if (mutt_str_strcmp(buf->data, np->pattern) == 0)
603  {
604  if (!*do_cache)
605  {
606  *do_cache = true;
607  }
608  mutt_debug(LL_DEBUG1, "Freeing pattern \"%s\" from ColorList\n", buf->data);
609  if (tmp)
610  STAILQ_REMOVE_AFTER(cl, tmp, entries);
611  else
612  STAILQ_REMOVE_HEAD(cl, entries);
614  break;
615  }
616  tmp = np;
617  }
618  }
619  } while (MoreArgs(s));
620 }
char * pattern
Definition: mutt_curses.h:184
#define STAILQ_REMOVE_HEAD(head, field)
Definition: queue.h:420
#define MoreArgs(buf)
Definition: buffer.h:43
#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:635
static void free_color_line(struct ColorLine *tmp, bool free_colors)
Free a ColorLine.
Definition: color.c:190
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:2638
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:77

+ 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
CommandResultResult e.g. MUTT_CMD_SUCCESS

usage:

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

Definition at line 635 of file color.c.

637 {
638  int object = 0;
639  bool do_cache = false;
640 
642 
643  object = mutt_map_get_value(buf->data, Fields);
644  if (object == -1)
645  {
646  mutt_buffer_printf(err, _("%s: no such object"), buf->data);
647  return MUTT_CMD_ERROR;
648  }
649 
650  if (object > MT_COLOR_INDEX_SUBJECT)
651  { /* uncolor index column */
652  ColorDefs[object] = 0;
654  return MUTT_CMD_SUCCESS;
655  }
656 
657  if (!mutt_str_startswith(buf->data, "body", CASE_MATCH) &&
658  !mutt_str_startswith(buf->data, "header", CASE_MATCH) &&
659  !mutt_str_startswith(buf->data, "index", CASE_MATCH))
660  {
661  mutt_buffer_printf(err, _("%s: command valid only for index, body, header objects"),
662  parse_uncolor ? "uncolor" : "unmono");
663  return MUTT_CMD_WARNING;
664  }
665 
666  if (!MoreArgs(s))
667  {
668  mutt_buffer_printf(err, _("%s: too few arguments"), parse_uncolor ? "uncolor" : "unmono");
669  return MUTT_CMD_WARNING;
670  }
671 
672  if (
673 #ifdef HAVE_COLOR
674  /* we're running without curses */
675  OptNoCurses || /* we're parsing an uncolor command, and have no colors */
676  (parse_uncolor && !has_colors())
677  /* we're parsing an unmono command, and have colors */
678  || (!parse_uncolor && has_colors())
679 #else
680  /* We don't even have colors compiled in */
682 #endif
683  )
684  {
685  /* just eat the command, but don't do anything real about it */
686  do
688  while (MoreArgs(s));
689 
690  return MUTT_CMD_SUCCESS;
691  }
692 
693  if (object == MT_COLOR_BODY)
694  do_uncolor(buf, s, &ColorBodyList, &do_cache, parse_uncolor);
695  else if (object == MT_COLOR_HEADER)
696  do_uncolor(buf, s, &ColorHdrList, &do_cache, parse_uncolor);
697  else if (object == MT_COLOR_ATTACH_HEADERS)
698  do_uncolor(buf, s, &ColorAttachList, &do_cache, parse_uncolor);
699  else if (object == MT_COLOR_INDEX)
700  do_uncolor(buf, s, &ColorIndexList, &do_cache, parse_uncolor);
701  else if (object == MT_COLOR_INDEX_AUTHOR)
702  do_uncolor(buf, s, &ColorIndexAuthorList, &do_cache, parse_uncolor);
703  else if (object == MT_COLOR_INDEX_FLAGS)
704  do_uncolor(buf, s, &ColorIndexFlagsList, &do_cache, parse_uncolor);
705  else if (object == MT_COLOR_INDEX_SUBJECT)
706  do_uncolor(buf, s, &ColorIndexSubjectList, &do_cache, parse_uncolor);
707  else if (object == MT_COLOR_INDEX_TAG)
708  do_uncolor(buf, s, &ColorIndexTagList, &do_cache, parse_uncolor);
709 
710  bool is_index = ((object == MT_COLOR_INDEX) || (object == MT_COLOR_INDEX_AUTHOR) ||
711  (object == MT_COLOR_INDEX_FLAGS) || (object == MT_COLOR_INDEX_SUBJECT) ||
712  (object == MT_COLOR_INDEX_TAG));
713 
714  if (is_index && do_cache && !OptNoCurses)
715  {
717  /* force re-caching of index colors */
718  for (int i = 0; Context && i < Context->mailbox->msg_count; i++)
719  Context->mailbox->emails[i]->pair = 0;
720  }
721  return MUTT_CMD_SUCCESS;
722 }
struct Email ** emails
Array of Emails.
Definition: mailbox.h:110
Index: subject field (takes a pattern)
Definition: mutt_curses.h:160
The "current" mailbox.
Definition: context.h:36
int msg_count
Total number of messages.
Definition: mailbox.h:102
Error: Can&#39;t help the user.
Definition: mutt_commands.h:35
struct ColorLineHead ColorIndexFlagsList
List of colours applied to the flags in the index.
Definition: color.c:60
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:574
struct ColorLineHead ColorBodyList
List of colours applied to the email body.
Definition: color.c:57
#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:46
Match case when comparing strings.
Definition: string2.h:67
Index panel (list of emails)
Definition: keymap.h:77
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:43
struct Mailbox * mailbox
Definition: context.h:50
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:59
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:635
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:2638
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:58
int ColorDefs[MT_COLOR_MAX]
Array of all fixed colours, see enum ColorId.
Definition: color.c:55
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:37
Warning: Help given to the user.
Definition: mutt_commands.h:36
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:62
struct ColorLineHead ColorIndexTagList
List of colours applied to tags in the index.
Definition: color.c:63
struct ColorLineHead ColorIndexList
List of default colours applied to the index.
Definition: color.c:61
int pair
Color-pair to use when displaying in the index.
Definition: email.h:81
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
Definition: mutt.h:77
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:115
struct ColorLineHead ColorAttachList
List of colours applied to the attachment headers.
Definition: color.c:56

+ 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 740 of file color.c.

742 {
743  return parse_uncolor(buf, s, data, err, false);
744 }
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:635

+ Here is the call graph for this function:

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 759 of file color.c.

762 {
763  /* is_index used to store compiled pattern
764  * only for 'index' color object
765  * when called from mutt_parse_color() */
766 
767  struct ColorLine *tmp = NULL;
768 
769  STAILQ_FOREACH(tmp, top, entries)
770  {
771  if (sensitive)
772  {
773  if (mutt_str_strcmp(s, tmp->pattern) == 0)
774  break;
775  }
776  else
777  {
778  if (mutt_str_strcasecmp(s, tmp->pattern) == 0)
779  break;
780  }
781  }
782 
783  if (tmp)
784  {
785 #ifdef HAVE_COLOR
786  if ((fg != COLOR_UNSET) && (bg != COLOR_UNSET))
787  {
788  if ((tmp->fg != fg) || (tmp->bg != bg))
789  {
790  mutt_free_color(tmp->fg, tmp->bg);
791  tmp->fg = fg;
792  tmp->bg = bg;
793  attr |= mutt_alloc_color(fg, bg);
794  }
795  else
796  attr |= (tmp->pair & ~A_BOLD);
797  }
798 #endif /* HAVE_COLOR */
799  tmp->pair = attr;
800  }
801  else
802  {
803  tmp = new_color_line();
804  if (is_index)
805  {
806  struct Buffer *buf = mutt_buffer_pool_get();
807  mutt_buffer_strcpy(buf, s);
811  if (!tmp->color_pattern)
812  {
813  free_color_line(tmp, true);
814  return MUTT_CMD_ERROR;
815  }
816  }
817  else
818  {
819  int flags = 0;
820  if (sensitive)
821  flags = mutt_mb_is_lower(s) ? REG_ICASE : 0;
822  else
823  flags = REG_ICASE;
824 
825  const int r = REG_COMP(&tmp->regex, s, flags);
826  if (r != 0)
827  {
828  regerror(r, &tmp->regex, err->data, err->dsize);
829  free_color_line(tmp, true);
830  return MUTT_CMD_ERROR;
831  }
832  }
833  tmp->pattern = mutt_str_strdup(s);
834  tmp->match = match;
835 #ifdef HAVE_COLOR
836  if ((fg != COLOR_UNSET) && (bg != COLOR_UNSET))
837  {
838  tmp->fg = fg;
839  tmp->bg = bg;
840  attr |= mutt_alloc_color(fg, bg);
841  }
842 #endif
843  tmp->pair = attr;
844  STAILQ_INSERT_HEAD(top, tmp, entries);
845  }
846 
847  /* force re-caching of index colors */
848  if (is_index)
849  {
850  for (int i = 0; Context && i < Context->mailbox->msg_count; i++)
851  Context->mailbox->emails[i]->pair = 0;
852  }
853 
854  return MUTT_CMD_SUCCESS;
855 }
struct Email ** emails
Array of Emails.
Definition: mailbox.h:110
The "current" mailbox.
Definition: context.h:36
#define NONULL(x)
Definition: string2.h:37
int msg_count
Total number of messages.
Definition: mailbox.h:102
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:35
void mutt_check_simple(struct Buffer *buf, const char *simple)
Convert a simple search into a real request.
Definition: pattern.c:2297
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
Definition: pool.c:86
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:50
#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:175
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:190
uint32_t bg
Definition: mutt_curses.h:188
struct PatternHead * mutt_pattern_comp(const char *s, PatternCompFlags flags, struct Buffer *err)
Create a Pattern.
Definition: pattern.c:1386
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:147
regex_t regex
Definition: mutt_curses.h:182
Success: Command worked.
Definition: mutt_commands.h:37
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
#define MUTT_PC_FULL_MSG
Enable body and header matching.
Definition: pattern.h:43
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:81
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

+ 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,
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 867 of file color.c.

869 {
870  if (!MoreArgs(s))
871  {
872  mutt_buffer_printf(err, _("%s: too few arguments"), "color");
873  return -1;
874  }
875 
877  if (mutt_str_startswith(buf->data, "quoted", CASE_MATCH))
878  {
879  if (buf->data[6])
880  {
881  char *eptr = NULL;
882  *ql = strtoul(buf->data + 6, &eptr, 10);
883  if (*eptr || (*ql == COLOR_UNSET))
884  {
885  mutt_buffer_printf(err, _("%s: no such object"), buf->data);
886  return -1;
887  }
888  }
889  else
890  *ql = 0;
891 
892  *o = MT_COLOR_QUOTED;
893  }
894  else if (mutt_str_strcasecmp(buf->data, "compose") == 0)
895  {
896  if (!MoreArgs(s))
897  {
898  mutt_buffer_printf(err, _("%s: too few arguments"), "color");
899  return -1;
900  }
901 
903 
905  if (*o == -1)
906  {
907  mutt_buffer_printf(err, _("%s: no such object"), buf->data);
908  return -1;
909  }
910  }
911  else if ((*o = mutt_map_get_value(buf->data, Fields)) == -1)
912  {
913  mutt_buffer_printf(err, _("%s: no such object"), buf->data);
914  return -1;
915  }
916 
917  return 0;
918 }
static const struct Mapping ComposeFields[]
Definition: color.c:160
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:43
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:2638
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:77
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:115

+ 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,
uint32_t *  fg,
uint32_t *  bg,
int *  attr,
struct Buffer err 
)
static

Parse an attribute description - Implements parser_callback_t.

Definition at line 991 of file color.c.

993 {
994  if (fg)
995  *fg = COLOR_UNSET;
996  if (bg)
997  *bg = COLOR_UNSET;
998 
999  if (!MoreArgs(s))
1000  {
1001  mutt_buffer_printf(err, _("%s: too few arguments"), "mono");
1002  return -1;
1003  }
1004 
1006 
1007  if (mutt_str_strcasecmp("bold", buf->data) == 0)
1008  *attr |= A_BOLD;
1009  else if (mutt_str_strcasecmp("underline", buf->data) == 0)
1010  *attr |= A_UNDERLINE;
1011  else if (mutt_str_strcasecmp("none", buf->data) == 0)
1012  *attr = A_NORMAL;
1013  else if (mutt_str_strcasecmp("reverse", buf->data) == 0)
1014  *attr |= A_REVERSE;
1015  else if (mutt_str_strcasecmp("standout", buf->data) == 0)
1016  *attr |= A_STANDOUT;
1017  else if (mutt_str_strcasecmp("normal", buf->data) == 0)
1018  *attr = A_NORMAL; /* needs use = instead of |= to clear other bits */
1019  else
1020  {
1021  mutt_buffer_printf(err, _("%s: no such attribute"), buf->data);
1022  return -1;
1023  }
1024 
1025  return 0;
1026 }
#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:43
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
Definition: init.c:2638
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:77

+ 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 1035 of file color.c.

1036 {
1037 #ifdef HAVE_COLOR
1038  if ((fg != COLOR_UNSET) && (bg != COLOR_UNSET))
1039  return attr | mutt_alloc_color(fg, bg);
1040  else
1041 #endif
1042  return attr;
1043 }
int mutt_alloc_color(uint32_t fg, uint32_t bg)

+ 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
CommandResultResult e.g. MUTT_CMD_SUCCESS

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

Definition at line 1058 of file color.c.

1061 {
1062  int attr = 0;
1063  uint32_t fg = 0, bg = 0, object = 0, q_level = 0, match = 0;
1064  enum CommandResult rc = MUTT_CMD_SUCCESS;
1065 
1066  if (parse_object(buf, s, &object, &q_level, err) == -1)
1067  return MUTT_CMD_ERROR;
1068 
1069  if (callback(buf, s, &fg, &bg, &attr, err) == -1)
1070  return MUTT_CMD_ERROR;
1071 
1072  /* extract a regular expression if needed */
1073 
1074  if ((object == MT_COLOR_BODY) || (object == MT_COLOR_HEADER) ||
1075  (object == MT_COLOR_ATTACH_HEADERS) || (object == MT_COLOR_INDEX) ||
1076  (object == MT_COLOR_INDEX_AUTHOR) || (object == MT_COLOR_INDEX_FLAGS) ||
1077  (object == MT_COLOR_INDEX_TAG) || (object == MT_COLOR_INDEX_SUBJECT))
1078  {
1079  if (!MoreArgs(s))
1080  {
1081  mutt_buffer_printf(err, _("%s: too few arguments"), color ? "color" : "mono");
1082  return MUTT_CMD_WARNING;
1083  }
1084 
1086  }
1087 
1088  if (MoreArgs(s) && (object != MT_COLOR_STATUS))
1089  {
1090  mutt_buffer_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
1091  return MUTT_CMD_WARNING;
1092  }
1093 
1094  /* dry run? */
1095 
1096  if (dry_run)
1097  {
1098  *s->dptr = '\0'; /* fake that we're done parsing */
1099  return MUTT_CMD_SUCCESS;
1100  }
1101 
1102 #ifdef HAVE_COLOR
1103 #ifdef HAVE_USE_DEFAULT_COLORS
1104  if (!OptNoCurses &&
1105  has_colors()
1106  /* delay use_default_colors() until needed, since it initializes things */
1107  && ((fg == COLOR_DEFAULT) || (bg == COLOR_DEFAULT) || (object == MT_COLOR_TREE)) &&
1108  (use_default_colors() != OK))
1109  /* the case of the tree object is special, because a non-default fg color of
1110  * the tree element may be combined dynamically with the default bg color of
1111  * an index line, not necessarily defined in a rc file. */
1112  {
1113  mutt_buffer_strcpy(err, _("default colors not supported"));
1114  return MUTT_CMD_ERROR;
1115  }
1116 #endif /* HAVE_USE_DEFAULT_COLORS */
1117 #endif
1118 
1119  if (object == MT_COLOR_HEADER)
1120  rc = add_pattern(&ColorHdrList, buf->data, false, fg, bg, attr, err, false, match);
1121  else if (object == MT_COLOR_BODY)
1122  rc = add_pattern(&ColorBodyList, buf->data, true, fg, bg, attr, err, false, match);
1123  else if (object == MT_COLOR_ATTACH_HEADERS)
1124  rc = add_pattern(&ColorAttachList, buf->data, true, fg, bg, attr, err, false, match);
1125  else if ((object == MT_COLOR_STATUS) && MoreArgs(s))
1126  {
1127  /* 'color status fg bg' can have up to 2 arguments:
1128  * 0 arguments: sets the default status color (handled below by else part)
1129  * 1 argument : colorize pattern on match
1130  * 2 arguments: colorize nth submatch of pattern */
1132 
1133  if (MoreArgs(s))
1134  {
1135  struct Buffer temporary = { 0 };
1136  mutt_extract_token(&temporary, s, MUTT_TOKEN_NO_FLAGS);
1137  mutt_str_atoui(temporary.data, &match);
1138  FREE(&temporary.data);
1139  }
1140 
1141  if (MoreArgs(s))
1142  {
1143  mutt_buffer_printf(err, _("%s: too many arguments"), color ? "color" : "mono");
1144  return MUTT_CMD_WARNING;
1145  }
1146 
1147  rc = add_pattern(&ColorStatusList, buf->data, true, fg, bg, attr, err, false, match);
1148  }
1149  else if (object == MT_COLOR_INDEX)
1150  {
1151  rc = add_pattern(&ColorIndexList, buf->data, true, fg, bg, attr, err, true, match);
1153  }
1154  else if (object == MT_COLOR_INDEX_AUTHOR)
1155  {
1156  rc = add_pattern(&ColorIndexAuthorList, buf->data, true, fg, bg, attr, err, true, match);
1158  }
1159  else if (object == MT_COLOR_INDEX_FLAGS)
1160  {
1161  rc = add_pattern(&ColorIndexFlagsList, buf->data, true, fg, bg, attr, err, true, match);
1163  }
1164  else if (object == MT_COLOR_INDEX_SUBJECT)
1165  {
1166  rc = add_pattern(&ColorIndexSubjectList, buf->data, true, fg, bg, attr, err, true, match);
1168  }
1169  else if (object == MT_COLOR_INDEX_TAG)
1170  {
1171  rc = add_pattern(&ColorIndexTagList, buf->data, true, fg, bg, attr, err, true, match);
1173  }
1174  else if (object == MT_COLOR_QUOTED)
1175  {
1176  if (q_level >= ColorQuoteSize)
1177  {
1178  mutt_mem_realloc(&ColorQuote, (ColorQuoteSize += 2) * sizeof(int));
1181  }
1182  if (q_level >= ColorQuoteUsed)
1183  ColorQuoteUsed = q_level + 1;
1184  if (q_level == 0)
1185  {
1186  ColorDefs[MT_COLOR_QUOTED] = fgbgattr_to_color(fg, bg, attr);
1187 
1189  for (q_level = 1; q_level < ColorQuoteUsed; q_level++)
1190  {
1191  if (ColorQuote[q_level] == A_NORMAL)
1192  ColorQuote[q_level] = ColorDefs[MT_COLOR_QUOTED];
1193  }
1194  }
1195  else
1196  ColorQuote[q_level] = fgbgattr_to_color(fg, bg, attr);
1197  }
1198  else
1199  {
1200  ColorDefs[object] = fgbgattr_to_color(fg, bg, attr);
1201  if (object > MT_COLOR_INDEX_AUTHOR)
1203  }
1204 
1205  return rc;
1206 }
Index: subject field (takes a pattern)
Definition: mutt_curses.h:160
CommandResult
Error codes for command_t parse functions.
Definition: mutt_commands.h:33
Error: Can&#39;t help the user.
Definition: mutt_commands.h:35
int * ColorQuote
Array of colours for quoted email text.
Definition: color.c:53
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:867
struct ColorLineHead ColorIndexFlagsList
List of colours applied to the flags in the index.
Definition: color.c:60
Pager: quoted text.
Definition: mutt_curses.h:126
static int ColorQuoteSize
Definition: color.c:67
struct ColorLineHead ColorBodyList
List of colours applied to the email body.
Definition: color.c:57
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:54
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:46
Index panel (list of emails)
Definition: keymap.h:77
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:43
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:59
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:2638
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:58
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:1035
int ColorDefs[MT_COLOR_MAX]
Array of all fixed colours, see enum ColorId.
Definition: color.c:55
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:759
Success: Command worked.
Definition: mutt_commands.h:37
Warning: Help given to the user.
Definition: mutt_commands.h:36
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:62
struct ColorLineHead ColorIndexTagList
List of colours applied to tags in the index.
Definition: color.c:63
#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:64
struct ColorLineHead ColorIndexList
List of default colours applied to the index.
Definition: color.c:61
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
Definition: mutt.h:77
struct ColorLineHead ColorAttachList
List of colours applied to the attachment headers.
Definition: color.c:56

+ 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 1229 of file color.c.

1231 {
1232  bool dry_run = false;
1233 
1234 #ifdef HAVE_COLOR
1235  if (OptNoCurses || has_colors())
1236  dry_run = true;
1237 #else
1238  if (OptNoCurses)
1239  dry_run = true;
1240 #endif
1241 
1242  return parse_color(buf, s, err, parse_attr_spec, dry_run, false);
1243 }
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:991
WHERE bool OptNoCurses
(pseudo) when sending in batch mode
Definition: options.h:46
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:1058

+ 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 1249 of file color.c.

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

+ 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 1262 of file color.c.

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

+ 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 53 of file color.c.

int ColorQuoteUsed

Number of colours for quoted email text.

Definition at line 54 of file color.c.

int ColorDefs[MT_COLOR_MAX]

Array of all fixed colours, see enum ColorId.

Definition at line 55 of file color.c.

struct ColorLineHead ColorAttachList = STAILQ_HEAD_INITIALIZER(ColorAttachList)

List of colours applied to the attachment headers.

Definition at line 56 of file color.c.

struct ColorLineHead ColorBodyList = STAILQ_HEAD_INITIALIZER(ColorBodyList)

List of colours applied to the email body.

Definition at line 57 of file color.c.

struct ColorLineHead ColorHdrList = STAILQ_HEAD_INITIALIZER(ColorHdrList)

List of colours applied to the email headers.

Definition at line 58 of file color.c.

struct ColorLineHead ColorIndexAuthorList = STAILQ_HEAD_INITIALIZER(ColorIndexAuthorList)

List of colours applied to the author in the index.

Definition at line 59 of file color.c.

struct ColorLineHead ColorIndexFlagsList = STAILQ_HEAD_INITIALIZER(ColorIndexFlagsList)

List of colours applied to the flags in the index.

Definition at line 60 of file color.c.

struct ColorLineHead ColorIndexList = STAILQ_HEAD_INITIALIZER(ColorIndexList)

List of default colours applied to the index.

Definition at line 61 of file color.c.

struct ColorLineHead ColorIndexSubjectList = STAILQ_HEAD_INITIALIZER(ColorIndexSubjectList)

List of colours applied to the subject in the index.

Definition at line 62 of file color.c.

struct ColorLineHead ColorIndexTagList = STAILQ_HEAD_INITIALIZER(ColorIndexTagList)

List of colours applied to tags in the index.

Definition at line 63 of file color.c.

struct ColorLineHead ColorStatusList = STAILQ_HEAD_INITIALIZER(ColorStatusList)

List of colours applied to the status bar.

Definition at line 64 of file color.c.

int ColorQuoteSize
static

Definition at line 67 of file color.c.

const struct Mapping Fields[]
static

Definition at line 115 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 160 of file color.c.