{ NULL, 0 }
};
+static const struct mapping_t ComposeFields[] =
+{
+ { "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 }
+};
+
#define COLOR_QUOTE_INIT 8
static COLOR_LINE *mutt_new_color_line (void)
*o = MT_COLOR_QUOTED;
}
+ else if (!ascii_strcasecmp(buf->data, "compose"))
+ {
+ if (!MoreArgs(s))
+ {
+ strfcpy(err->data, _("Missing arguments."), err->dsize);
+ return -1;
+ }
+
+ mutt_extract_token(buf, s, 0);
+
+ if ((*o = mutt_getvaluebyname (buf->data, ComposeFields)) == -1)
+ {
+ snprintf (err->data, err->dsize, _("%s: no such object"), buf->data);
+ return (-1);
+ }
+ }
else if ((*o = mutt_getvaluebyname (buf->data, Fields)) == -1)
{
snprintf (err->data, err->dsize, _("%s: no such object"), buf->data);
static void redraw_crypt_lines (HEADER *msg)
{
+ SETCOLOR (MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw (MuttIndexWindow, HDR_CRYPT, 0, TITLE_FMT, "Security: ");
+ NORMAL_COLOR;
if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0)
{
}
if ((msg->security & (ENCRYPT | SIGN)) == (ENCRYPT | SIGN))
+ {
+ SETCOLOR (MT_COLOR_COMPOSE_SECURITY_BOTH);
addstr (_("Sign, Encrypt"));
+ }
else if (msg->security & ENCRYPT)
+ {
+ SETCOLOR (MT_COLOR_COMPOSE_SECURITY_ENCRYPT);
addstr (_("Encrypt"));
+ }
else if (msg->security & SIGN)
+ {
+ SETCOLOR (MT_COLOR_COMPOSE_SECURITY_SIGN);
addstr (_("Sign"));
+ }
else
+ {
+ SETCOLOR (MT_COLOR_COMPOSE_SECURITY_NONE);
addstr (_("None"));
+ }
+ NORMAL_COLOR;
if ((msg->security & (ENCRYPT | SIGN)))
{
if ((WithCrypto & APPLICATION_PGP)
&& (msg->security & APPLICATION_PGP) && (msg->security & SIGN))
- printw (TITLE_FMT "%s", _("sign as: "), PgpSignAs ? PgpSignAs : _("<default>"));
+ {
+ SETCOLOR (MT_COLOR_COMPOSE_HEADER);
+ printw (TITLE_FMT, _("sign as: "));
+ NORMAL_COLOR;
+ printw ("%s", PgpSignAs ? PgpSignAs : _("<default>"));
+ }
if ((WithCrypto & APPLICATION_SMIME)
- && (msg->security & APPLICATION_SMIME) && (msg->security & SIGN)) {
- printw (TITLE_FMT "%s", _("sign as: "), SmimeDefaultKey ? SmimeDefaultKey : _("<default>"));
+ && (msg->security & APPLICATION_SMIME) && (msg->security & SIGN))
+ {
+ SETCOLOR (MT_COLOR_COMPOSE_HEADER);
+ printw (TITLE_FMT, _("sign as: "));
+ NORMAL_COLOR;
+ printw ("%s", SmimeDefaultKey ? SmimeDefaultKey : _("<default>"));
}
if ((WithCrypto & APPLICATION_SMIME)
&& (msg->security & APPLICATION_SMIME)
&& (msg->security & ENCRYPT)
&& SmimeCryptAlg
- && *SmimeCryptAlg) {
- mutt_window_mvprintw (MuttIndexWindow, HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "),
- NONULL(SmimeCryptAlg));
+ && *SmimeCryptAlg)
+ {
+ SETCOLOR (MT_COLOR_COMPOSE_HEADER);
+ mutt_window_mvprintw (MuttIndexWindow, HDR_CRYPTINFO, 40, "%s", _("Encrypt with: "));
+ NORMAL_COLOR;
+ printw ("%s", NONULL(SmimeCryptAlg));
}
}
int c;
char *t;
+ SETCOLOR (MT_COLOR_COMPOSE_HEADER);
/* L10N: "Mix" refers to the MixMaster chain for anonymous email */
mutt_window_mvprintw (MuttIndexWindow, HDR_MIX, 0, TITLE_FMT, _("Mix: "));
+ NORMAL_COLOR;
if (!chain)
{
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), addr, 1);
+ SETCOLOR (MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw (MuttIndexWindow, line, 0, TITLE_FMT, Prompts[line]);
+ NORMAL_COLOR;
mutt_paddstr (W, buf);
}
draw_envelope_addr (HDR_TO, msg->env->to);
draw_envelope_addr (HDR_CC, msg->env->cc);
draw_envelope_addr (HDR_BCC, msg->env->bcc);
+
+ SETCOLOR (MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw (MuttIndexWindow, HDR_SUBJECT, 0, TITLE_FMT, Prompts[HDR_SUBJECT]);
+ NORMAL_COLOR;
mutt_paddstr (W, NONULL (msg->env->subject));
+
draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to);
+
+ SETCOLOR (MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw (MuttIndexWindow, HDR_FCC, 0, TITLE_FMT, Prompts[HDR_FCC]);
+ NORMAL_COLOR;
mutt_paddstr (W, fcc);
if (WithCrypto)
<replaceable class="parameter">pattern</replaceable>
</arg>
+<command>color</command>
+<arg choice="plain">
+<option>compose</option>
+</arg>
+<arg choice="plain">
+<replaceable class="parameter">composeobject</replaceable>
+</arg>
+<arg choice="plain">
+<replaceable class="parameter">foreground</replaceable>
+</arg>
+<arg choice="plain">
+<replaceable class="parameter">background</replaceable>
+</arg>
+
<command>uncolor</command>
<group choice="req">
<arg choice="plain">
<listitem><para>underline (highlighting underlined patterns in the body of messages)</para></listitem>
</itemizedlist>
+<para>
+<emphasis>composeobject</emphasis> can be one of:
+</para>
+
+<itemizedlist>
+<listitem><para>header</para></listitem>
+<listitem><para>security_encrypt</para></listitem>
+<listitem><para>security_sign</para></listitem>
+<listitem><para>security_both</para></listitem>
+<listitem><para>security_none</para></listitem>
+</itemizedlist>
+
<para>
<emphasis>foreground</emphasis> and <emphasis>background</emphasis> can
be one of the following:
<replaceable class="parameter">pattern</replaceable>
</arg>
+<command>mono</command>
+<arg choice="plain">
+<option>compose</option>
+</arg>
+<arg choice="plain">
+<replaceable class="parameter">composeobject</replaceable>
+</arg>
+<arg choice="plain">
+<replaceable class="parameter">attribute</replaceable>
+</arg>
+
<command>unmono</command>
<group choice="req">
<arg choice="plain">
</cmdsynopsis>
<para>
-For <emphasis>object</emphasis>, see the <command>color</command>
-command. <emphasis>attribute</emphasis> can be one of the following:
+For <emphasis>object</emphasis> and <emphasis>composeobject</emphasis>,
+see the <command>color</command> command. <emphasis>attribute</emphasis>
+can be one of the following:
</para>
<itemizedlist>
<replaceable class="parameter">pattern</replaceable>
</arg>
+<command><link linkend="color">color</link></command>
+<arg choice="plain">
+<option>compose</option>
+</arg>
+<arg choice="plain">
+<replaceable class="parameter">composeobject</replaceable>
+</arg>
+<arg choice="plain">
+<replaceable class="parameter">foreground</replaceable>
+</arg>
+<arg choice="plain">
+<replaceable class="parameter">background</replaceable>
+</arg>
+
<command><link linkend="color">uncolor</link></command>
<group choice="req">
<arg choice="plain">
<replaceable class="parameter">pattern</replaceable>
</arg>
+<command><link linkend="mono">mono</link></command>
+<arg choice="plain">
+<option>compose</option>
+</arg>
+<arg choice="plain">
+<replaceable class="parameter">composeobject</replaceable>
+</arg>
+<arg choice="plain">
+<replaceable class="parameter">attribute</replaceable>
+</arg>
+
<command><link linkend="mono">unmono</link></command>
<group choice="req">
<arg choice="plain">
MT_COLOR_SB_INDICATOR,
MT_COLOR_SB_SPOOLFILE,
#endif
+ MT_COLOR_COMPOSE_HEADER,
+ MT_COLOR_COMPOSE_SECURITY_ENCRYPT,
+ MT_COLOR_COMPOSE_SECURITY_SIGN,
+ MT_COLOR_COMPOSE_SECURITY_BOTH,
+ MT_COLOR_COMPOSE_SECURITY_NONE,
MT_COLOR_MAX
};