]> granicus.if.org Git - neomutt/commitdiff
merge: index-color
authorRichard Russon <rich@flatcap.org>
Thu, 18 Aug 2016 16:45:58 +0000 (17:45 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 18 Aug 2016 17:07:30 +0000 (18:07 +0100)
 * add ident to PATCHES
 * feature: index-color
 * reformat

1  2 
PATCHES
color.c
curs_lib.c
hdrline.c
mutt.h
mutt_curses.h

diff --cc PATCHES
index e78b39bce4f8ee1c8b960afd67aa490e583db934,44c6cf148403d073a7c8546cef65edc6850491eb..a45c49a57031fe46535408894881cfaa46c9eda8
+++ b/PATCHES
@@@ -1,13 -1,1 +1,14 @@@
 +patch-cond-date-neomutt
 +patch-fmemopen-neomutt
 +patch-ifdef-neomutt
+ patch-index-color-neomutt
 +patch-initials-neomutt
 +patch-limit-current-thread-neomutt
 +patch-lmdb-neomutt
 +patch-nested-if-neomutt
 +patch-new-mail-neomutt
 +patch-progress-neomutt
 +patch-quasi-delete-neomutt
 +patch-skip-quoted-neomutt
 +patch-smime-encrypt-self-neomutt
 +patch-status-color-neomutt
diff --cc color.c
index 052e23271d32c6d9c374db12047361211da7b8d9,227cc542e60be784f6cf0272573e0610ecae0af8..7b8f7cc4500ca41cd6fe315b74f0ee454c0a44e5
+++ b/color.c
@@@ -34,8 -34,10 +34,11 @@@ int ColorQuoteUsed
  int ColorDefs[MT_COLOR_MAX];
  COLOR_LINE *ColorHdrList = NULL;
  COLOR_LINE *ColorBodyList = NULL;
 +COLOR_LINE *ColorStatusList = NULL;
  COLOR_LINE *ColorIndexList = NULL;
+ COLOR_LINE *ColorIndexAuthorList = NULL;
+ COLOR_LINE *ColorIndexFlagsList = NULL;
+ COLOR_LINE *ColorIndexSubjectList = NULL;
  
  /* local to this file */
  static int ColorQuoteSize;
@@@ -94,7 -96,14 +97,15 @@@ static const struct mapping_t Fields[] 
    { "bold",           MT_COLOR_BOLD },
    { "underline",      MT_COLOR_UNDERLINE },
    { "index",          MT_COLOR_INDEX },
 +  { "progress",               MT_COLOR_PROGRESS },
+   { "index_author",   MT_COLOR_INDEX_AUTHOR },
+   { "index_collapsed",        MT_COLOR_INDEX_COLLAPSED },
+   { "index_date",     MT_COLOR_INDEX_DATE },
+   { "index_flags",    MT_COLOR_INDEX_FLAGS },
+   { "index_label",    MT_COLOR_INDEX_LABEL },
+   { "index_number",   MT_COLOR_INDEX_NUMBER },
+   { "index_size",     MT_COLOR_INDEX_SIZE },
+   { "index_subject",  MT_COLOR_INDEX_SUBJECT },
    { "prompt",         MT_COLOR_PROMPT },
  #ifdef USE_SIDEBAR
    { "sidebar_divider",        MT_COLOR_DIVIDER },
@@@ -766,39 -810,29 +813,57 @@@ _mutt_parse_color (BUFFER *buf, BUFFER 
  #endif
    
    if (object == MT_COLOR_HEADER)
 -    r = add_pattern (&ColorHdrList, buf->data, 0, fg, bg, attr, err,0);
 +    r = add_pattern (&ColorHdrList, buf->data, 0, fg, bg, attr, err, 0, match);
    else if (object == MT_COLOR_BODY)
 -    r = add_pattern (&ColorBodyList, buf->data, 1, fg, bg, attr, err, 0);
 +    r = add_pattern (&ColorBodyList, buf->data, 1, fg, bg, attr, err, 0, match);
 +  else if ((object == MT_COLOR_STATUS) && MoreArgs (s)) {
-     /* 'color status fg bg' can have upto 2 arguments:
++    /* 'color status fg bg' can have up to 2 arguments:
 +     * 0 arguments: sets the default status color (handled below by else part)
 +     * 1 argument : colorize pattern on match
 +     * 2 arguments: colorize nth submatch of pattern
 +     */
 +    mutt_extract_token (buf, s, 0);
 +
 +    if (MoreArgs (s)) {
 +      BUFFER temporary;
 +      memset (&temporary, 0, sizeof (BUFFER));
 +      mutt_extract_token (&temporary, s, 0);
 +      match = atoi (temporary.data);
 +      FREE(&temporary.data);
 +    }
 +
 +    if (MoreArgs (s)) {
 +      strfcpy (err->data, _("too many arguments"), err->dsize);
 +      return -1;
 +    }
 +
 +    r = add_pattern (&ColorStatusList, buf->data, 1,
 +                  fg, bg, attr, err, 0, match);
 +  }
    else if (object == MT_COLOR_INDEX)
    {
 -    r = add_pattern (&ColorIndexList, buf->data, 1, fg, bg, attr, err, 1);
 +    r = add_pattern (&ColorIndexList, buf->data, 1,
 +                  fg, bg, attr, err, 1, match);
      set_option (OPTFORCEREDRAWINDEX);
    }
 -    r = add_pattern (&ColorIndexAuthorList, buf->data, 1, fg, bg, attr, err, 1);
+   else if (object == MT_COLOR_INDEX_AUTHOR)
+   {
 -    r = add_pattern (&ColorIndexFlagsList, buf->data, 1, fg, bg, attr, err, 1);
++    r = add_pattern (&ColorIndexAuthorList, buf->data, 1,
++                  fg, bg, attr, err, 1, match);
+     set_option (OPTFORCEREDRAWINDEX);
+   }
+   else if (object == MT_COLOR_INDEX_FLAGS)
+   {
 -    r = add_pattern (&ColorIndexSubjectList, buf->data, 1, fg, bg, attr, err, 1);
++    r = add_pattern (&ColorIndexFlagsList, buf->data, 1,
++                  fg, bg, attr, err, 1, match);
+     set_option (OPTFORCEREDRAWINDEX);
+   }
+   else if (object == MT_COLOR_INDEX_SUBJECT)
+   {
++    r = add_pattern (&ColorIndexSubjectList, buf->data, 1,
++                  fg, bg, attr, err, 1, match);
+     set_option (OPTFORCEREDRAWINDEX);
+   }
    else if (object == MT_COLOR_QUOTED)
    {
      if (q_level >= ColorQuoteSize)
diff --cc curs_lib.c
Simple merge
diff --cc hdrline.c
Simple merge
diff --cc mutt.h
Simple merge
diff --cc mutt_curses.h
index 8237cfdab68c124d6ceeead1aa607985840a3252,25604f9135d56c788821c41c8c9f45c06222dca5..bc94cb98978620bf78f416ee5cc0e7b6ff4a2846
@@@ -111,9 -121,7 +111,8 @@@ enu
    MT_COLOR_SEARCH,
    MT_COLOR_BOLD,
    MT_COLOR_UNDERLINE,
-   MT_COLOR_INDEX,
    MT_COLOR_PROMPT,
 +  MT_COLOR_PROGRESS,
  #ifdef USE_SIDEBAR
    MT_COLOR_DIVIDER,
    MT_COLOR_FLAGGED,
@@@ -204,8 -222,10 +214,11 @@@ extern int ColorQuoteUsed
  extern int ColorDefs[];
  extern COLOR_LINE *ColorHdrList;
  extern COLOR_LINE *ColorBodyList;
 +extern COLOR_LINE *ColorStatusList;
  extern COLOR_LINE *ColorIndexList;
+ extern COLOR_LINE *ColorIndexAuthorList;
+ extern COLOR_LINE *ColorIndexFlagsList;
+ extern COLOR_LINE *ColorIndexSubjectList;
  
  void ci_init_color (void);
  void ci_start_color (void);