updated on Wed Jan 25 12:16:47 UTC 2012
[aur-mirror.git] / mutt-great-dane / patch-1.5.21.indexcolor-3+cb.diff
blobd29d0ba7e5696277472d2a083c4833e4b156f04a
1 diff -ur mutt-1.5.20/PATCHES mutt-indexcolor/PATCHES
2 --- mutt-1.5.20/PATCHES 2010-07-11 19:32:01.396756181 -0400
3 +++ mutt-indexcolor/PATCHES 2010-07-11 19:33:38.536226982 -0400
4 @@ -0,0 +1 @@
5 +mutt-1.5.8-indexcolor-3
6 diff -ur mutt-1.5.20/color.c mutt-indexcolor/color.c
7 --- mutt-1.5.20/color.c 2010-07-11 19:32:01.310095183 -0400
8 +++ mutt-indexcolor/color.c 2010-07-11 19:41:38.359613634 -0400
9 @@ -35,6 +35,8 @@
10 COLOR_LINE *ColorHdrList = NULL;
11 COLOR_LINE *ColorBodyList = NULL;
12 COLOR_LINE *ColorIndexList = NULL;
13 +COLOR_LINE *ColorIndexSubjectList = NULL;
14 +COLOR_LINE *ColorIndexAuthorList = NULL;
16 /* local to this file */
17 static int ColorQuoteSize;
18 @@ -93,6 +95,14 @@
19 { "bold", MT_COLOR_BOLD },
20 { "underline", MT_COLOR_UNDERLINE },
21 { "index", MT_COLOR_INDEX },
22 + { "index_subject", MT_COLOR_INDEX_SUBJECT },
23 + { "index_author", MT_COLOR_INDEX_AUTHOR },
24 + { "index_collapsed", MT_COLOR_INDEX_COLLAPSED },
25 + { "index_date", MT_COLOR_INDEX_DATE },
26 + { "index_flags", MT_COLOR_INDEX_FLAGS },
27 + { "index_label", MT_COLOR_INDEX_LABEL },
28 + { "index_number", MT_COLOR_INDEX_NUMBER },
29 + { "index_size", MT_COLOR_INDEX_SIZE },
30 { "sidebar_new", MT_COLOR_NEW },
31 { "sidebar_flagged", MT_COLOR_FLAGGED },
32 { NULL, 0 }
33 @@ -366,6 +376,51 @@
34 return _mutt_parse_uncolor(buf, s, data, err, 0);
37 +static void
38 +mutt_do_uncolor (BUFFER *buf, BUFFER *s, COLOR_LINE **ColorList,
39 + int *do_cache, int parse_uncolor)
41 + COLOR_LINE *tmp, *last = NULL;
43 + do
44 + {
45 + mutt_extract_token (buf, s, 0);
46 + if (!mutt_strcmp ("*", buf->data))
47 + {
48 + for (tmp = *ColorList; tmp; )
49 + {
50 + if (!*do_cache)
51 + *do_cache = 1;
52 + last = tmp;
53 + tmp = tmp->next;
54 + mutt_free_color_line(&last, parse_uncolor);
55 + }
56 + *ColorList = NULL;
57 + }
58 + else
59 + {
60 + for (last = NULL, tmp = *ColorList; tmp; last = tmp, tmp = tmp->next)
61 + {
62 + if (!mutt_strcmp (buf->data, tmp->pattern))
63 + {
64 + if (!*do_cache)
65 + *do_cache = 1;
66 + dprint(1,(debugfile,"Freeing pattern \"%s\" from ColorList\n",
67 + tmp->pattern));
68 + if (last)
69 + last->next = tmp->next;
70 + else
71 + *ColorList = tmp->next;
72 + mutt_free_color_line(&tmp, parse_uncolor);
73 + break;
74 + }
75 + }
76 + }
77 + }
78 + while (MoreArgs (s));
82 static int _mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data,
83 BUFFER *err, short parse_uncolor)
85 @@ -381,6 +436,13 @@
86 return (-1);
89 + if (object > MT_COLOR_INDEX_AUTHOR) /* uncolor index column */
90 + {
91 + ColorDefs[object] = 0;
92 + set_option (OPTFORCEREDRAWINDEX);
93 + return (0);
94 + }
96 if (mutt_strncmp (buf->data, "index", 5) == 0)
97 list = &ColorIndexList;
98 else if (mutt_strncmp (buf->data, "body", 4) == 0)
99 @@ -424,42 +486,12 @@
100 return 0;
103 - do
105 - mutt_extract_token (buf, s, 0);
106 - if (!mutt_strcmp ("*", buf->data))
108 - for (tmp = *list; tmp; )
110 - if (!do_cache)
111 - do_cache = 1;
112 - last = tmp;
113 - tmp = tmp->next;
114 - mutt_free_color_line(&last, parse_uncolor);
116 - *list = NULL;
118 - else
120 - for (last = NULL, tmp = *list; tmp; last = tmp, tmp = tmp->next)
122 - if (!mutt_strcmp (buf->data, tmp->pattern))
124 - if (!do_cache)
125 - do_cache = 1;
126 - dprint(1,(debugfile,"Freeing pattern \"%s\" from color list\n",
127 - tmp->pattern));
128 - if (last)
129 - last->next = tmp->next;
130 - else
131 - *list = tmp->next;
132 - mutt_free_color_line(&tmp, parse_uncolor);
133 - break;
138 - while (MoreArgs (s));
139 + if (object == MT_COLOR_INDEX)
140 + mutt_do_uncolor(buf, s, &ColorIndexList, &do_cache, parse_uncolor);
141 + if (object == MT_COLOR_INDEX_SUBJECT)
142 + mutt_do_uncolor(buf, s, &ColorIndexSubjectList, &do_cache, parse_uncolor);
143 + if (object == MT_COLOR_INDEX_AUTHOR)
144 + mutt_do_uncolor(buf, s, &ColorIndexAuthorList, &do_cache, parse_uncolor);
147 if (do_cache && !option (OPTNOCURSES))
148 @@ -700,7 +732,7 @@
150 /* extract a regular expression if needed */
152 - if (object == MT_COLOR_HEADER || object == MT_COLOR_BODY || object == MT_COLOR_INDEX)
153 + if (object == MT_COLOR_HEADER || object == MT_COLOR_BODY || object == MT_COLOR_INDEX || object == MT_COLOR_INDEX_SUBJECT || object == MT_COLOR_INDEX_AUTHOR)
155 if (!MoreArgs (s))
157 @@ -744,6 +776,18 @@
158 r = add_pattern (&ColorIndexList, buf->data, 1, fg, bg, attr, err, 1);
159 set_option (OPTFORCEREDRAWINDEX);
161 + else if (object == MT_COLOR_INDEX_SUBJECT)
163 + r = add_pattern (&ColorIndexSubjectList, buf->data,
164 + 1, fg, bg, attr, err, 1);
165 + set_option (OPTFORCEREDRAWINDEX);
167 + else if (object == MT_COLOR_INDEX_AUTHOR)
169 + r = add_pattern (&ColorIndexAuthorList, buf->data,
170 + 1, fg, bg, attr, err, 1);
171 + set_option (OPTFORCEREDRAWINDEX);
173 else if (object == MT_COLOR_QUOTED)
175 if (q_level >= ColorQuoteSize)
176 @@ -769,7 +813,11 @@
177 ColorQuote[q_level] = fgbgattr_to_color(fg, bg, attr);
179 else
181 ColorDefs[object] = fgbgattr_to_color(fg, bg, attr);
182 + if (object > MT_COLOR_INDEX_AUTHOR)
183 + set_option (OPTFORCEREDRAWINDEX);
186 #ifdef HAVE_COLOR
187 # ifdef HAVE_BKGDSET
188 diff -ur mutt-1.5.20/curs_lib.c mutt-indexcolor/curs_lib.c
189 --- mutt-1.5.20/curs_lib.c 2009-03-31 02:52:43.000000000 -0400
190 +++ mutt-indexcolor/curs_lib.c 2010-07-11 19:33:38.532584661 -0400
191 @@ -711,6 +711,7 @@
192 size_t k, k2;
193 char scratch[MB_LEN_MAX];
194 mbstate_t mbstate1, mbstate2;
195 + int escaped = 0;
197 memset(&mbstate1, 0, sizeof (mbstate1));
198 memset(&mbstate2, 0, sizeof (mbstate2));
199 @@ -726,7 +727,15 @@
200 k = (k == (size_t)(-1)) ? 1 : n;
201 wc = replacement_char ();
203 - if (arboreal && wc < M_TREE_MAX)
204 + if (escaped) {
205 + escaped = 0;
206 + w = 0;
208 + else if (arboreal && wc == M_SPECIAL_INDEX) {
209 + escaped = 1;
210 + w = 0;
212 + else if (arboreal && wc < M_TREE_MAX)
213 w = 1; /* hack */
214 else
216 diff -ur mutt-1.5.20/doc/manual.xml.head mutt-indexcolor/doc/manual.xml.head
217 --- mutt-1.5.20/doc/manual.xml.head 2010-07-11 19:32:01.400093495 -0400
218 +++ mutt-indexcolor/doc/manual.xml.head 2010-07-11 19:50:28.489149038 -0400
219 @@ -2470,7 +2470,7 @@
221 <command>color</command>
222 <arg choice="plain">
223 -<option>index</option>
224 +<option>object</option>
225 </arg>
226 <arg choice="plain">
227 <replaceable class="parameter">foreground</replaceable>
228 @@ -2485,7 +2485,7 @@
229 <command>uncolor</command>
230 <group choice="req">
231 <arg choice="plain">
232 -<option>index</option>
233 +<option>object</option>
234 </arg>
235 <arg choice="plain">
236 <option>header</option>
237 @@ -2526,6 +2526,14 @@
238 <listitem><para>bold (hiliting bold patterns in the body of messages)</para></listitem>
239 <listitem><para>error (error messages printed by Mutt)</para></listitem>
240 <listitem><para>hdrdefault (default color of the message header in the pager)</para></listitem>
241 +<listitem><para>index_author (color of the author name in the index, uses <emphasis>pattern</emphasis>)</para></listitem>
242 +<listitem><para>index_collapsed (the number of messages in a collapsed thread in the index)</para></listitem>
243 +<listitem><para>index_date (color of the date field in the index)</para></listitem>
244 +<listitem><para>index_flags (color of the message flags in the index)</para></listitem>
245 +<listitem><para>index_label (color of the message label in the index)</para></listitem>
246 +<listitem><para>index_number (color of the message number in the index)</para></listitem>
247 +<listitem><para>index_size (color of the message size and line number in the index)</para></listitem>
248 +<listitem><para>index_subject (color of the subject in the index, uses <emphasis>pattern</emphasis>)</para></listitem>
249 <listitem><para>indicator (arrow or bar used to indicate the current item in a menu)</para></listitem>
250 <listitem><para>markers (the <quote>+</quote> markers at the beginning of wrapped lines in the pager)</para></listitem>
251 <listitem><para>message (informational messages)</para></listitem>
252 diff -ur mutt-1.5.20/hdrline.c mutt-indexcolor/hdrline.c
253 --- mutt-1.5.20/hdrline.c 2010-07-11 19:32:01.373422137 -0400
254 +++ mutt-indexcolor/hdrline.c 2010-07-11 19:33:38.532584661 -0400
255 @@ -103,6 +103,34 @@
256 return 0;
259 +/* Takes the color to embed, the buffer to manipulate and the buffer length as
260 + * arguments.
261 + * Returns the number of chars written. */
262 +static size_t add_index_color(char *buf, size_t buflen,
263 + format_flag flags, char color)
265 + int len;
267 + /* only add color markers if we are operating on main index entries. */
268 + if (!(flags & M_FORMAT_INDEX))
269 + return 0;
271 + if (color == MT_COLOR_INDEX) { /* buf might be uninitialized other cases */
272 + len = mutt_strlen(buf);
273 + buf += len;
274 + buflen -= len;
277 + if (buflen < 2)
278 + return 0;
280 + buf[0] = M_SPECIAL_INDEX;
281 + buf[1] = color;
282 + buf[2] = '\0';
284 + return 2;
287 static void make_from (ENVELOPE *hdr, char *buf, size_t len, int do_lists)
289 int me;
290 @@ -257,6 +285,7 @@
291 #define THREAD_NEW (threads && hdr->collapsed && hdr->num_hidden > 1 && mutt_thread_contains_unread (ctx, hdr) == 1)
292 #define THREAD_OLD (threads && hdr->collapsed && hdr->num_hidden > 1 && mutt_thread_contains_unread (ctx, hdr) == 2)
293 size_t len;
294 + size_t colorlen;
296 hdr = hfi->hdr;
297 ctx = hfi->ctx;
298 @@ -308,12 +337,17 @@
299 break;
301 case 'c':
302 + colorlen = add_index_color(dest, destlen, flags, MT_COLOR_INDEX_SIZE);
303 mutt_pretty_size (buf2, sizeof (buf2), (long) hdr->content->length);
304 - mutt_format_s (dest, destlen, prefix, buf2);
305 + mutt_format_s (dest+colorlen, destlen-colorlen, prefix, buf2);
306 + add_index_color(dest+colorlen, destlen-colorlen, flags, MT_COLOR_INDEX);
307 break;
309 case 'C':
310 - snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
311 + colorlen = add_index_color(fmt, sizeof(fmt), flags, MT_COLOR_INDEX_NUMBER);
312 + snprintf (fmt+colorlen, sizeof(fmt)-colorlen, "%%%sd", prefix);
313 + add_index_color(fmt+colorlen, sizeof(fmt)-colorlen, flags, MT_COLOR_INDEX);
315 snprintf (dest, destlen, fmt, hdr->msgno + 1);
316 break;
318 @@ -412,7 +446,10 @@
319 if (do_locales)
320 setlocale (LC_TIME, "C");
322 - mutt_format_s (dest, destlen, prefix, buf2);
323 + colorlen = add_index_color(dest, destlen, flags, MT_COLOR_INDEX_DATE);
324 + mutt_format_s (dest+colorlen, destlen-colorlen, prefix, buf2);
325 + add_index_color(dest+colorlen, destlen-colorlen, flags, MT_COLOR_INDEX);
327 if (len > 0 && op != 'd' && op != 'D') /* Skip ending op */
328 src = cp + 1;
330 @@ -442,8 +479,10 @@
331 case 'F':
332 if (!optional)
334 + colorlen = add_index_color(dest, destlen, flags, MT_COLOR_INDEX_AUTHOR);
335 make_from (hdr->env, buf2, sizeof (buf2), 0);
336 - mutt_format_s (dest, destlen, prefix, buf2);
337 + mutt_format_s (dest+colorlen, destlen-colorlen, prefix, buf2);
338 + add_index_color(dest+colorlen, destlen-colorlen, flags, MT_COLOR_INDEX);
340 else if (mutt_addr_is_user (hdr->env->from))
341 optional = 0;
342 @@ -500,7 +539,9 @@
343 if (!optional)
345 snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
346 - snprintf (dest, destlen, fmt, (int) hdr->lines);
347 + colorlen = add_index_color(dest, destlen, flags, MT_COLOR_INDEX_SIZE);
348 + snprintf (dest+colorlen, destlen-colorlen, fmt, (int) hdr->lines);
349 + add_index_color(dest+colorlen, destlen-colorlen, flags, MT_COLOR_INDEX);
351 else if (hdr->lines <= 0)
352 optional = 0;
353 @@ -509,8 +550,10 @@
354 case 'L':
355 if (!optional)
357 + colorlen = add_index_color(dest, destlen, flags, MT_COLOR_INDEX_AUTHOR);
358 make_from (hdr->env, buf2, sizeof (buf2), 1);
359 - mutt_format_s (dest, destlen, prefix, buf2);
360 + mutt_format_s (dest+colorlen, destlen-colorlen, prefix, buf2);
361 + add_index_color(dest+colorlen, destlen-colorlen, flags, MT_COLOR_INDEX);
363 else if (!check_for_mailing_list (hdr->env->to, NULL, NULL, 0) &&
364 !check_for_mailing_list (hdr->env->cc, NULL, NULL, 0))
365 @@ -565,10 +608,16 @@
366 snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
367 if (!optional)
369 - if (threads && is_index && hdr->collapsed && hdr->num_hidden > 1)
370 - snprintf (dest, destlen, fmt, hdr->num_hidden);
371 - else if (is_index && threads)
372 - mutt_format_s (dest, destlen, prefix, " ");
373 + colorlen = add_index_color(dest, destlen, flags,
374 + MT_COLOR_INDEX_COLLAPSED);
375 + if (threads && is_index && hdr->collapsed && hdr->num_hidden > 1) {
376 + snprintf (dest+colorlen, destlen-colorlen, fmt, hdr->num_hidden);
377 + add_index_color(dest, destlen-colorlen, flags, MT_COLOR_INDEX);
379 + else if (is_index && threads) {
380 + mutt_format_s (dest+colorlen, destlen-colorlen, prefix, " ");
381 + add_index_color(dest, destlen-colorlen, flags, MT_COLOR_INDEX);
383 else
384 *dest = '\0';
386 @@ -598,15 +647,23 @@
388 if (flags & M_FORMAT_FORCESUBJ)
390 - mutt_format_s (dest, destlen, "", NONULL (hdr->env->subject));
391 + colorlen = add_index_color(dest, destlen, flags, MT_COLOR_INDEX_SUBJECT);
392 + mutt_format_s (dest+colorlen, destlen-colorlen, "",
393 + NONULL (hdr->env->subject));
394 + add_index_color(dest+colorlen, destlen-colorlen, flags, MT_COLOR_INDEX);
396 snprintf (buf2, sizeof (buf2), "%s%s", hdr->tree, dest);
397 mutt_format_s_tree (dest, destlen, prefix, buf2);
399 else
400 mutt_format_s_tree (dest, destlen, prefix, hdr->tree);
402 - else
403 - mutt_format_s (dest, destlen, prefix, NONULL (hdr->env->subject));
404 + else {
405 + colorlen = add_index_color(dest, destlen, flags, MT_COLOR_INDEX_SUBJECT);
406 + mutt_format_s (dest+colorlen, destlen-colorlen, prefix,
407 + NONULL (hdr->env->subject));
408 + add_index_color(dest+colorlen, destlen-colorlen, flags, MT_COLOR_INDEX);
410 break;
412 case 'S':
413 @@ -709,7 +766,9 @@
414 hdr->tagged ? '*' :
415 (hdr->flagged ? '!' :
416 (Tochars && ((i = mutt_user_is_recipient (hdr)) < mutt_strlen (Tochars)) ? Tochars[i] : ' ')));
417 - mutt_format_s (dest, destlen, prefix, buf2);
418 + colorlen = add_index_color(dest, destlen, flags, MT_COLOR_INDEX_FLAGS);
419 + mutt_format_s (dest+colorlen, destlen-colorlen, prefix, buf2);
420 + add_index_color(dest+colorlen, destlen-colorlen, flags, MT_COLOR_INDEX);
421 break;
423 case 'X':
424 @@ -729,7 +788,9 @@
425 if (optional)
426 optional = hdr->env->x_label ? 1 : 0;
428 - mutt_format_s (dest, destlen, prefix, NONULL (hdr->env->x_label));
429 + colorlen = add_index_color(dest, destlen, flags, MT_COLOR_INDEX_LABEL);
430 + mutt_format_s (dest+colorlen, destlen-colorlen, prefix, NONULL (hdr->env->x_label));
431 + add_index_color(dest+colorlen, destlen-colorlen, flags, MT_COLOR_INDEX);
432 break;
434 case 'Y':
435 @@ -755,10 +816,12 @@
436 if (optional)
437 optional = i;
439 + colorlen = add_index_color(dest, destlen, flags, MT_COLOR_INDEX_LABEL);
440 if (i)
441 - mutt_format_s (dest, destlen, prefix, NONULL (hdr->env->x_label));
442 + mutt_format_s (dest+colorlen, destlen-colorlen, prefix, NONULL (hdr->env->x_label));
443 else
444 - mutt_format_s (dest, destlen, prefix, "");
445 + mutt_format_s (dest+colorlen, destlen-colorlen, prefix, "");
446 + add_index_color(dest+colorlen, destlen-colorlen, flags, MT_COLOR_INDEX);
448 break;
450 diff -ur mutt-1.5.20/menu.c mutt-indexcolor/menu.c
451 --- mutt-1.5.20/menu.c 2010-07-11 19:32:01.313427608 -0400
452 +++ mutt-indexcolor/menu.c 2010-07-11 19:44:52.525857008 -0400
453 @@ -35,7 +35,30 @@
455 char* SearchBuffers[MENU_MAX];
457 -static void print_enriched_string (int attr, unsigned char *s, int do_color)
458 +static int get_color(int index, int type) {
459 + COLOR_LINE *color;
460 + HEADER *hdr = Context->hdrs[index];
462 + switch (type) {
463 + case MT_COLOR_INDEX_SUBJECT:
464 + color = ColorIndexSubjectList;
465 + break;
466 + case MT_COLOR_INDEX_AUTHOR:
467 + color = ColorIndexAuthorList;
468 + break;
469 + default:
470 + return ColorDefs[type];
473 + for (; color; color = color->next)
474 + if (mutt_pattern_exec (color->color_pattern, M_MATCH_FULL_ADDRESS,
475 + Context, hdr))
476 + return color->pair;
478 + return 0;
481 +static void print_enriched_string (int index, int attr, unsigned char *s, int do_color)
483 wchar_t wc;
484 size_t k;
485 @@ -132,6 +155,18 @@
487 if (do_color) attrset(attr);
489 + else if(*s == M_SPECIAL_INDEX)
491 + s++;
492 + if (do_color) {
493 + if (*s == MT_COLOR_INDEX)
494 + attrset(attr);
495 + else
496 + attron(get_color(index, *s));
498 + s++;
499 + n -= 2;
501 else if ((k = mbrtowc (&wc, (char *)s, n, &mbstate)) > 0)
503 addnstr ((char *)s, k);
504 @@ -235,7 +270,7 @@
505 addstr (" ");
508 - print_enriched_string (menu->color(i), (unsigned char *) buf, 1);
509 + print_enriched_string (i, menu->color(i), (unsigned char *) buf, 1);
510 SETCOLOR (MT_COLOR_NORMAL);
512 else
513 @@ -249,7 +284,7 @@
516 CLEARLINE_WIN (i - menu->top + menu->offset);
517 - print_enriched_string (menu->color(i), (unsigned char *) buf, i != menu->current);
518 + print_enriched_string (i, menu->color(i), (unsigned char *) buf, i != menu->current);
519 SETCOLOR (MT_COLOR_NORMAL);
520 BKGDSET (MT_COLOR_NORMAL);
522 @@ -286,7 +321,7 @@
523 menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
524 menu_pad_string (buf, sizeof (buf));
525 move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth + 3);
526 - print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
527 + print_enriched_string (menu->oldcurrent, menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
528 SETCOLOR (MT_COLOR_NORMAL);
531 @@ -304,7 +339,7 @@
532 clrtoeol ();
533 menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
534 menu_pad_string (buf, sizeof (buf));
535 - print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
536 + print_enriched_string (menu->oldcurrent, menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
538 /* now draw the new one to reflect the change */
539 menu_make_entry (buf, sizeof (buf), menu, menu->current);
540 @@ -313,7 +348,7 @@
541 ADDCOLOR (MT_COLOR_INDICATOR);
542 BKGDSET (MT_COLOR_INDICATOR);
543 CLEARLINE_WIN (menu->current - menu->top + menu->offset);
544 - print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
545 + print_enriched_string (menu->current, menu->color(menu->current), (unsigned char *) buf, 0);
546 SETCOLOR (MT_COLOR_NORMAL);
547 BKGDSET (MT_COLOR_NORMAL);
549 @@ -339,7 +374,7 @@
550 attrset (attr);
551 addch (' ');
552 menu_pad_string (buf, sizeof (buf));
553 - print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 1);
554 + print_enriched_string (menu->current, menu->color(menu->current), (unsigned char *) buf, 1);
555 SETCOLOR (MT_COLOR_NORMAL);
557 else
558 @@ -348,7 +383,7 @@
559 ADDCOLOR (MT_COLOR_INDICATOR);
560 BKGDSET (MT_COLOR_INDICATOR);
561 clrtoeol ();
562 - print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
563 + print_enriched_string (menu->current, menu->color(menu->current), (unsigned char *) buf, 0);
564 SETCOLOR (MT_COLOR_NORMAL);
565 BKGDSET (MT_COLOR_NORMAL);
567 diff -ur mutt-1.5.20/mutt.h mutt-indexcolor/mutt.h
568 --- mutt-1.5.20/mutt.h 2010-07-11 19:32:01.390091196 -0400
569 +++ mutt-indexcolor/mutt.h 2010-07-11 19:33:38.536226982 -0400
570 @@ -168,6 +168,8 @@
571 #define M_TREE_MISSING 13
572 #define M_TREE_MAX 14
574 +#define M_SPECIAL_INDEX M_TREE_MAX
576 #define M_THREAD_COLLAPSE (1<<0)
577 #define M_THREAD_UNCOLLAPSE (1<<1)
578 #define M_THREAD_GET_HIDDEN (1<<2)
579 diff -ur mutt-1.5.20/mutt_curses.h mutt-indexcolor/mutt_curses.h
580 --- mutt-1.5.20/mutt_curses.h 2010-07-11 19:32:01.313427608 -0400
581 +++ mutt-indexcolor/mutt_curses.h 2010-07-11 19:45:49.266254982 -0400
582 @@ -127,6 +127,16 @@
583 MT_COLOR_BOLD,
584 MT_COLOR_UNDERLINE,
585 MT_COLOR_INDEX,
586 + /* please no non-MT_COLOR_INDEX objects after this point */
587 + MT_COLOR_INDEX_SUBJECT,
588 + MT_COLOR_INDEX_AUTHOR,
589 + /* below only index coloring stuff that doesn't have a colorline! */
590 + MT_COLOR_INDEX_COLLAPSED,
591 + MT_COLOR_INDEX_DATE,
592 + MT_COLOR_INDEX_FLAGS,
593 + MT_COLOR_INDEX_LABEL,
594 + MT_COLOR_INDEX_NUMBER,
595 + MT_COLOR_INDEX_SIZE,
596 MT_COLOR_NEW,
597 MT_COLOR_FLAGGED,
598 MT_COLOR_MAX
599 @@ -182,6 +192,8 @@
600 extern COLOR_LINE *ColorHdrList;
601 extern COLOR_LINE *ColorBodyList;
602 extern COLOR_LINE *ColorIndexList;
603 +extern COLOR_LINE *ColorIndexSubjectList;
604 +extern COLOR_LINE *ColorIndexAuthorList;
606 void ci_init_color (void);
607 void ci_start_color (void);