color now accepts zero or more attributes words before the foreground.
Also more or less resolves the issue that setting the color of an object
which defaults to underline/reverse is irreversible.
static int
parse_color_pair(BUFFER *buf, BUFFER *s, int *fg, int *bg, int *attr, BUFFER *err)
{
- if (! MoreArgs (s))
+ FOREVER
{
- strfcpy (err->data, _("color: too few arguments"), err->dsize);
- return (-1);
- }
+ if (! MoreArgs (s))
+ {
+ strfcpy (err->data, _("color: too few arguments"), err->dsize);
+ return (-1);
+ }
- mutt_extract_token (buf, s, 0);
+ mutt_extract_token (buf, s, 0);
- if (parse_color_name (buf->data, fg, attr, 1, err) != 0)
- return (-1);
+ if (ascii_strcasecmp ("bold", buf->data) == 0)
+ *attr |= A_BOLD;
+ else if (ascii_strcasecmp ("underline", buf->data) == 0)
+ *attr |= A_UNDERLINE;
+ else if (ascii_strcasecmp ("none", buf->data) == 0)
+ *attr = A_NORMAL;
+ else if (ascii_strcasecmp ("reverse", buf->data) == 0)
+ *attr |= A_REVERSE;
+ else if (ascii_strcasecmp ("standout", buf->data) == 0)
+ *attr |= A_STANDOUT;
+ else if (ascii_strcasecmp ("normal", buf->data) == 0)
+ *attr = A_NORMAL; /* needs use = instead of |= to clear other bits */
+ else
+ {
+ if (parse_color_name (buf->data, fg, attr, 1, err) != 0)
+ return (-1);
+ break;
+ }
+ }
if (! MoreArgs (s))
{
<arg choice="plain">
<replaceable class="parameter">object</replaceable>
</arg>
+<arg choice="opt" rep="repeat">
+<replaceable class="parameter">attribute</replaceable>
+</arg>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<option>body</option>
</arg>
</group>
+<arg choice="opt" rep="repeat">
+<replaceable class="parameter">attribute</replaceable>
+</arg>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<arg choice="plain">
<option>index</option>
</arg>
+<arg choice="opt" rep="repeat">
+<replaceable class="parameter">attribute</replaceable>
+</arg>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">composeobject</replaceable>
</arg>
+<arg choice="opt" rep="repeat">
+<replaceable class="parameter">attribute</replaceable>
+</arg>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<listitem><para>security_none</para></listitem>
</itemizedlist>
+<para>
+<emphasis>attribute</emphasis> can be one of the following:
+</para>
+
+<itemizedlist>
+<listitem><para>none</para></listitem>
+<listitem><para>bold</para></listitem>
+<listitem><para>underline</para></listitem>
+<listitem><para>reverse</para></listitem>
+<listitem><para>standout</para></listitem>
+</itemizedlist>
+
<para>
<emphasis>foreground</emphasis> and <emphasis>background</emphasis> can
be one of the following:
</cmdsynopsis>
<para>
-For <emphasis>object</emphasis> and <emphasis>composeobject</emphasis>,
-see the <command>color</command> command. <emphasis>attribute</emphasis>
-can be one of the following:
+For <emphasis>object</emphasis>, <emphasis>composeobject</emphasis>, and
+<emphasis>attribute</emphasis>, see the <command>color</command> command.
</para>
-
-<itemizedlist>
-<listitem><para>none</para></listitem>
-<listitem><para>bold</para></listitem>
-<listitem><para>underline</para></listitem>
-<listitem><para>reverse</para></listitem>
-<listitem><para>standout</para></listitem>
-</itemizedlist>
-
</sect1>
<sect1 id="msg-hdr-display">
<arg choice="plain">
<replaceable class="parameter">object</replaceable>
</arg>
+<arg choice="opt" rep="repeat">
+<replaceable class="parameter">attribute</replaceable>
+</arg>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<option>body</option>
</arg>
</group>
+<arg choice="opt" rep="repeat">
+<replaceable class="parameter">attribute</replaceable>
+</arg>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<arg choice="plain">
<option>index</option>
</arg>
+<arg choice="opt" rep="repeat">
+<replaceable class="parameter">attribute</replaceable>
+</arg>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
<arg choice="plain">
<replaceable class="parameter">composeobject</replaceable>
</arg>
+<arg choice="opt" rep="repeat">
+<replaceable class="parameter">attribute</replaceable>
+</arg>
<arg choice="plain">
<replaceable class="parameter">foreground</replaceable>
</arg>
specify multiple maps, put only a comma between the maps.
.PP
.nf
-\fBcolor\fP \fIobject\fP \fIforeground\fP \fIbackground\fP [ \fIregexp\fP ]
-\fBcolor\fP index \fIforeground\fP \fIbackground\fP [ \fIpattern\fP ]
+\fBcolor\fP \fIobject\fP [ \fIattribute\fP ... ] \fIforeground\fP \fIbackground\fP [ \fIregexp\fP ]
+\fBcolor\fP index [ \fIattribute\fP ... ] \fIforeground\fP \fIbackground\fP [ \fIpattern\fP ]
\fBuncolor\fP index \fIpattern\fP [ \fIpattern\fP ... ]
.fi
.IP
Valid colors include:
.BR white ", " black ", " green ", " magenta ", " blue ", "
.BR cyan ", " yellow ", " red ", " default ", " color\fIN\fP .
+.IP
+Valid attributes include:
+.BR none ", " bold ", " underline ", "
+.BR reverse ", and " standout .
.PP
.nf
\fBmono\fP \fIobject\fP \fIattribute\fP [ \fIregexp\fP ]
.fi
.IP
For terminals which don't support color, you can still assign
-attributes to objects. Valid attributes include:
-.BR none ", " bold ", " underline ", "
-.BR reverse ", and " standout .
+attributes to objects.
.TP
[\fBun\fP]\fBignore\fP \fIpattern\fP [ \fIpattern\fP ... ]
The \fBignore\fP command permits you to specify header fields which