Distinguish between errors and warnings in the log and displayed on screen.
color warning brightyellow default
{ "tilde", MT_COLOR_TILDE },
{ "tree", MT_COLOR_TREE },
{ "underline", MT_COLOR_UNDERLINE },
+ { "warning", MT_COLOR_WARNING },
{ NULL, 0 },
};
MT_COLOR_SB_SPOOLFILE, ///< $spoolfile (Spool mailbox)
#endif
MT_COLOR_MESSAGE_LOG, ///< Menu showing log messages
+ MT_COLOR_WARNING, ///< Warning messages
/* please no non-MT_COLOR_INDEX objects after this point */
MT_COLOR_INDEX, ///< Index: default colour (takes a pattern)
MT_COLOR_INDEX_AUTHOR, ///< Index: author field (takes a pattern)
{
if (rc == MUTT_CMD_SUCCESS) /* command succeeded with message */
mutt_message("%s", err.data);
- else /* error executing command */
+ else if (rc == MUTT_CMD_ERROR)
mutt_error("%s", err.data);
+ else if (rc == MUTT_CMD_WARNING)
+ mutt_warning("%s", err.data);
}
}
/* else successful command */
color markers brightcyan default
color attachment brightmagenta default
color search default green # how to hilite search patterns in the pager
+color warning brightyellow default
color header brightred default ^(From|Subject):
color body magenta default "(ftp|http|https)://[^ ]+" # point out URLs
struct ListNode *np = NULL;
STAILQ_FOREACH(np, p, entries)
{
- if (mutt_parse_rc_line(np->data, token, err) == MUTT_CMD_ERROR)
- {
+ enum CommandResult rc2 = mutt_parse_rc_line(np->data, token, err);
+ if (rc2 == MUTT_CMD_ERROR)
mutt_error(_("Error in command line: %s"), mutt_b2s(err));
+
+ if ((rc2 == MUTT_CMD_ERROR) || (rc2 == MUTT_CMD_WARNING))
+ mutt_warning(_("Warning in command line: %s"), mutt_b2s(err));
+
+ if ((rc2 == MUTT_CMD_ERROR) || (rc2 == MUTT_CMD_WARNING))
+ {
mutt_buffer_pool_release(&token);
mutt_buffer_pool_release(&err);
-
return -1;
}
}
if (!OptKeepQuiet)
{
- if (level == LL_ERROR)
- mutt_beep(false);
- mutt_curses_set_color((level == LL_ERROR) ? MT_COLOR_ERROR : MT_COLOR_MESSAGE);
+ switch (level)
+ {
+ case LL_ERROR:
+ mutt_beep(false);
+ mutt_curses_set_color(MT_COLOR_ERROR);
+ break;
+ case LL_WARNING:
+ mutt_curses_set_color(MT_COLOR_WARNING);
+ break;
+ default:
+ mutt_curses_set_color(MT_COLOR_MESSAGE);
+ break;
+ }
+
mutt_window_mvaddstr(MuttMessageWindow, 0, 0, ErrorBuf);
mutt_curses_set_color(MT_COLOR_NORMAL);
mutt_window_clrtoeol(MuttMessageWindow);
(*line_info)[n].type = MT_COLOR_MESSAGE_LOG;
if (buf[11] == 'M')
(*line_info)[n].syntax[0].color = MT_COLOR_MESSAGE;
+ else if (buf[11] == 'W')
+ (*line_info)[n].syntax[0].color = MT_COLOR_WARNING;
else if (buf[11] == 'E')
(*line_info)[n].syntax[0].color = MT_COLOR_ERROR;
else