Re: mutt/2630: color indicator doesn't accept regex as described in manual
The following reply was made to PR mutt/2630; it has been noted by GNATS.
From: Sweth Chandramouli <mutt@xxxxxxxxxxxxxxx>
To: bug-any@xxxxxxxxxxxxx
Cc:
Subject: Re: mutt/2630: color indicator doesn't accept regex as described in
manual
Date: Sun, 25 Mar 2007 13:00:54 -0400
On Sunday, 25 March 2007 at 11:44:40 EDT,
Alain Bench (<veronatif@xxxxxxx>) wrote:
> Yes. In "Usage: color object foreground background [ regexp ]", the
> regexp is not really optional, but either prohibited or mandatory,
> depending on the object. And the list of objects states which ones want
> a regexp. The indicator object doesn't take a regexp (just like
> attachment, bold, error, hdrdefault, and some such...).
>
> This documentation seems rather clear to me, as it is. Would you (or
> anyone else) have a suggestion enhancing the clarity of this point?
Square brackets in command syntax definitions almost universally means
"optional argument", so if it's clear to you how it should be used, I
have to assume that that is because you already know how it should be
used--multiple others that I've asked about this (including others on the
mutt-users list) all agree that the usage summary given should mean that
a regexp can be optionally used with any object.
Also, until you explained it above, it was non-obvious to me that the
references to regexps in the object list was meant to indicate which
objects accepted regexps--those references seem more like clarifications
of exactly what the regexp is matched against if used for that
particular object.
The best way that I can see to clarify the docs would be to follow the
example of the index, which gets its own syntax definition, and give
separate syntaxes for regexp-compatible and non-regex-compatible
objects. It might even make sense to generalize the index definition
into a pattern_object definition:
color re_object foreground background regexp
color non_re_object foreground background
color pattern_object foreground background pattern
uncolor pattern_object pattern [ pattern ... ]
re_object can be one of:
* body (match regexp in the body of messages)
* header (match regexp in the message header)
non_re_object can be one of:
* attachment
* error
(etc ... )
pattern_object can currently only be:
* index (match pattern in the message index)
. That would make it obvious to everyone that regexps are only for
certain objects.
> Note that adding regexp support to indicator was previously
> discussed and rejected due to needless muttrc overcomplexity (see
> wish/1717 at <URL:http://bugs.mutt.org/1717>). The usual solution is to
> set color index at will, and use the default "mono indicator reverse".
AFAIK, mono commands only apply when using a terminal that doesn't
support color. Do they also affect color displays as well? Testing
just now doesn't seem to show any change if I set mono indicator
reverse. In either case, though, ow would that give the desired effect
(in my case, to have the foreground color stay the same regardless of
whether the line is selected or not)? (FWIW, I'm not lobbying for
addition of regexp support for indicator as a feature; it would be nice
for me, but it's not a deal-breaker. My main concern was that the docs
don't describe the actual behaviour.)
-- Sweth.
--
Sweth Chandramouli - http://EthicalHomes.com/
Real Estate Brokerage through Keller Williams Realty, Vienna, VA
Mortgage Brokerage through HomeFirst Mortgage, Alexandria, VA
Solutions for buyers, sellers, and homeowners in DC, VA, and MD
Referrals to first-rate Realtors and Mortgage Brokers nationwide