{"send2-hook", mutt_parse_hook, M_SEND2HOOK},
{"send-hook", mutt_parse_hook, M_SENDHOOK},
{"macro", mutt_parse_macro, 0},
- {"mono", mutt_parse_mono, 0},
{"push", mutt_parse_push, 0},
{"uncolor", mutt_parse_uncolor, 0},
{"unhook", mutt_parse_unhook, 0},
- {"unmono", mutt_parse_unmono, 0},
{"alias", parse_alias, 0},
{"attachments", parse_attachments, 0 },
{"my_hdr", parse_my_hdr, 0},
return 0;
}
-/* usage: uncolor index pattern [pattern...]
- * unmono index pattern [pattern...]
- */
-
-static int
-_mutt_parse_uncolor (BUFFER * buf, BUFFER * s, unsigned long data,
- BUFFER * err, short parse_uncolor);
-
-int mutt_parse_uncolor (BUFFER * buf, BUFFER * s, unsigned long data,
- BUFFER * err)
-{
- return _mutt_parse_uncolor (buf, s, data, err, 1);
-}
-
-int mutt_parse_unmono (BUFFER * buf, BUFFER * s, unsigned long data,
- BUFFER * err)
-{
- return _mutt_parse_uncolor (buf, s, data, err, 0);
-}
-
-static int
-_mutt_parse_uncolor (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ ((unused)),
- BUFFER * err, short parse_uncolor)
+/* usage: uncolor index pattern [pattern...] */
+int mutt_parse_uncolor(BUFFER *buf, BUFFER *s, unsigned long data, BUFFER
+ *err)
{
int object = 0, do_cache = 0;
COLOR_LINE *tmp, *last = NULL;
if (m_strncmp(buf->data, "index", 5) != 0) {
snprintf (err->data, err->dsize,
- _("%s: command valid only for index object"),
- parse_uncolor ? "uncolor" : "unmono");
+ _("%s: command valid only for index object"), "uncolor");
return (-1);
}
if (!MoreArgs (s)) {
- snprintf (err->data, err->dsize,
- _("%s: too few arguments"),
- parse_uncolor ? "uncolor" : "unmono");
+ snprintf (err->data, err->dsize, _("%s: too few arguments"), "uncolor");
return (-1);
}
- if (option (OPTNOCURSES) || (parse_uncolor != has_colors())) {
+ if (option(OPTNOCURSES) || !has_colors()) {
/* just eat the command, but don't do anything real about it */
do {
mutt_extract_token (buf, s, 0);
return 0;
}
+#if 0
static int
parse_attr_spec (BUFFER * buf, BUFFER * s, int *fg, int *bg, int *attr,
BUFFER * err)
return 0;
}
+#endif
static int fgbgattr_to_color (int fg, int bg, int attr)
{
return attr;
}
-/* usage: color <object> <fg> <bg> [ <regexp> ]
- * mono <object> <attr> [ <regexp> ]
- */
-
-static int
-_mutt_parse_color (BUFFER * buf, BUFFER * s, BUFFER * err,
- parser_callback_t callback, short dry_run)
+/* usage: color <object> <fg> <bg> [ <regexp> ] */
+int mutt_parse_color(BUFFER *buf, BUFFER *s, unsigned long i, BUFFER *err)
{
int object = 0, attr = 0, fg = 0, bg = 0, q_level = 0;
int r = 0;
+ int dry_run = option (OPTNOCURSES) || !has_colors ();
if (parse_object (buf, s, &object, &q_level, err) == -1)
return -1;
- if (callback (buf, s, &fg, &bg, &attr, err) == -1)
+ if (parse_color_pair(buf, s, &fg, &bg, &attr, err) == -1)
return -1;
/* extract a regular expression if needed */
return (r);
}
-
-int mutt_parse_color (BUFFER * buff, BUFFER * s, unsigned long data __attribute__ ((unused)),
- BUFFER * err)
-{
- int dry_run = 0;
-
- if (option (OPTNOCURSES) || !has_colors ())
- dry_run = 1;
-
- return _mutt_parse_color (buff, s, err, parse_color_pair, dry_run);
-}
-
-int mutt_parse_mono (BUFFER * buff, BUFFER * s, unsigned long data __attribute__ ((unused)),
- BUFFER * err)
-{
- int dry_run = 0;
-
- if (option (OPTNOCURSES) || has_colors ())
- dry_run = 1;
-
- return _mutt_parse_color (buff, s, err, parse_attr_spec, dry_run);
-}