changeset: 6393:25430a489665
user: Kevin McCarthy <[email protected]>
date: Fri Jan 09 14:22:01 2015 -0800
link: http://dev.mutt.org/hg/mutt/rev/25430a489665
Add color type for prompts.
This adds a new color type, MT_COLOR_PROMPT, that can be used to
colorize prompts (fields, yes/no, multi_choice).
Thanks to Ben Boeckel for the patch!
diffs (101 lines):
diff -r 789501922727 -r 25430a489665 color.c
--- a/color.c Tue Oct 29 18:25:52 2013 -0700
+++ b/color.c Fri Jan 09 14:22:01 2015 -0800
@@ -93,6 +93,7 @@
{ "bold", MT_COLOR_BOLD },
{ "underline", MT_COLOR_UNDERLINE },
{ "index", MT_COLOR_INDEX },
+ { "prompt", MT_COLOR_PROMPT },
{ NULL, 0 }
};
diff -r 789501922727 -r 25430a489665 contrib/colors.default
--- a/contrib/colors.default Tue Oct 29 18:25:52 2013 -0700
+++ b/contrib/colors.default Fri Jan 09 14:22:01 2015 -0800
@@ -6,6 +6,7 @@
color quoted blue white
color signature red white
color attachment red white
+color prompt brightmagenta white
color message brightred white
color error brightred white
color indicator brightyellow red
diff -r 789501922727 -r 25430a489665 contrib/colors.linux
--- a/contrib/colors.linux Tue Oct 29 18:25:52 2013 -0700
+++ b/contrib/colors.linux Fri Jan 09 14:22:01 2015 -0800
@@ -6,6 +6,7 @@
color quoted blue black
color signature blue black
color attachment red black
+color prompt brightmagenta black
color message brightred black
color error brightred black
color indicator black red
diff -r 789501922727 -r 25430a489665 curs_lib.c
--- a/curs_lib.c Tue Oct 29 18:25:52 2013 -0700
+++ b/curs_lib.c Fri Jan 09 14:22:01 2015 -0800
@@ -139,7 +139,9 @@
do
{
CLEARLINE (LINES-1);
+ SETCOLOR (MT_COLOR_PROMPT);
addstr ((char *)field); /* cast to get around bad prototypes */
+ NORMAL_COLOR;
mutt_refresh ();
getyx (stdscr, y, x);
ret = _mutt_enter_string (buf, buflen, y, x, complete, multiple, files,
numfiles, es);
@@ -225,8 +227,10 @@
answer_string_len = mutt_strwidth (answer_string);
/* maxlen here is sort of arbitrary, so pick a reasonable upper bound */
msglen = mutt_wstr_trunc (msg, 4*COLS, COLS - answer_string_len, NULL);
+ SETCOLOR (MT_COLOR_PROMPT);
addnstr (msg, msglen);
addstr (answer_string);
+ NORMAL_COLOR;
FREE (&answer_string);
FOREVER
@@ -647,7 +651,9 @@
int choice;
char *p;
+ SETCOLOR (MT_COLOR_PROMPT);
mvaddstr (LINES - 1, 0, prompt);
+ NORMAL_COLOR;
clrtoeol ();
FOREVER
{
diff -r 789501922727 -r 25430a489665 doc/manual.xml.head
--- a/doc/manual.xml.head Tue Oct 29 18:25:52 2013 -0700
+++ b/doc/manual.xml.head Fri Jan 09 14:22:01 2015 -0800
@@ -2644,6 +2644,7 @@
<listitem><para>markers (the <quote>+</quote> markers at the beginning of
wrapped lines in the pager)</para></listitem>
<listitem><para>message (informational messages)</para></listitem>
<listitem><para>normal</para></listitem>
+<listitem><para>prompt</para></listitem>
<listitem><para>quoted (text matching <link
linkend="quote-regexp">$quote_regexp</link> in the body of a
message)</para></listitem>
<listitem><para>quoted1, quoted2, ..., quoted<emphasis>N</emphasis> (higher
levels of quoting)</para></listitem>
<listitem><para>search (highlighting of words in the pager)</para></listitem>
diff -r 789501922727 -r 25430a489665 doc/muttrc.man.head
--- a/doc/muttrc.man.head Tue Oct 29 18:25:52 2013 -0700
+++ b/doc/muttrc.man.head Fri Jan 09 14:22:01 2015 -0800
@@ -233,7 +233,7 @@
.BR hdrdefault ", " index ", " indicator ", " markers ", "
.BR message ", " normal ", " quoted ", " quoted\fIN\fP ", "
.BR search ", " signature ", " status ", " tilde ", " tree ", "
-.BR underline .
+.BR underline ", " prompt .
The
.BR body " and " header
objects allow you to restrict the colorization to a regular
diff -r 789501922727 -r 25430a489665 mutt_curses.h
--- a/mutt_curses.h Tue Oct 29 18:25:52 2013 -0700
+++ b/mutt_curses.h Fri Jan 09 14:22:01 2015 -0800
@@ -120,6 +120,7 @@
MT_COLOR_BOLD,
MT_COLOR_UNDERLINE,
MT_COLOR_INDEX,
+ MT_COLOR_PROMPT,
MT_COLOR_MAX
};