From: Pierre Habouzit Date: Sat, 10 Nov 2007 16:01:29 +0000 (+0100) Subject: Mono-only terminals are from another century. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=0afc63845401ca26097e3c48445741e0f1b99bec;p=apps%2Fmadmutt.git Mono-only terminals are from another century. Signed-off-by: Pierre Habouzit --- diff --git a/init.h b/init.h index 9031847..7f6bcb9 100644 --- a/init.h +++ b/init.h @@ -2038,11 +2038,9 @@ struct command_t Commands[] = { {"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}, diff --git a/lib-ui/color.c b/lib-ui/color.c index a927e9a..207d959 100644 --- a/lib-ui/color.c +++ b/lib-ui/color.c @@ -144,29 +144,9 @@ parse_color_name (const char *s, int *col, int *attr, int brite, BUFFER * err) 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; @@ -180,19 +160,16 @@ _mutt_parse_uncolor (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ 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); @@ -381,6 +358,7 @@ parse_color_pair (BUFFER * buf, BUFFER * s, int *fg, int *bg, int *attr, return 0; } +#if 0 static int parse_attr_spec (BUFFER * buf, BUFFER * s, int *fg, int *bg, int *attr, BUFFER * err) @@ -417,6 +395,7 @@ parse_attr_spec (BUFFER * buf, BUFFER * s, int *fg, int *bg, int *attr, return 0; } +#endif static int fgbgattr_to_color (int fg, int bg, int attr) { @@ -426,21 +405,17 @@ static int fgbgattr_to_color (int fg, int bg, int attr) return attr; } -/* usage: color [ ] - * mono [ ] - */ - -static int -_mutt_parse_color (BUFFER * buf, BUFFER * s, BUFFER * err, - parser_callback_t callback, short dry_run) +/* usage: color [ ] */ +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 */ @@ -510,25 +485,3 @@ _mutt_parse_color (BUFFER * buf, BUFFER * s, BUFFER * err, 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); -} diff --git a/lib-ui/curses.h b/lib-ui/curses.h index fe8b63e..b2f4d0b 100644 --- a/lib-ui/curses.h +++ b/lib-ui/curses.h @@ -132,8 +132,6 @@ int mutt_is_subscribed_list (address_t *); int mutt_multi_choice (const char *prompt, const char *letters); int mutt_parse_color (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_parse_uncolor (BUFFER *, BUFFER *, unsigned long, BUFFER *); -int mutt_parse_mono (BUFFER *, BUFFER *, unsigned long, BUFFER *); -int mutt_parse_unmono (BUFFER *, BUFFER *, unsigned long, BUFFER *); int mutt_query_complete (char *, ssize_t); int mutt_user_is_recipient (HEADER *); int mutt_yesorno (const char *, int);