Colorizing index lines that match two patterns

Kevin J. McCarthy kevin at 8t8.us
Fri Mar 26 01:19:44 UTC 2021


On Thu, Mar 25, 2021 at 03:09:56PM -0600, Akkana Peck wrote:
>"~N ~X 1-"
>~N ~X 1-
>"~N && ~X 1-"
>"~N" "~X 1-"
>
>but they all gave syntax errors.

For me,
   color index red white "~N ~X 1-"
works and gives no syntax errors.

>"~N ~X 1-
>Is this a bug?

It's semi-intentional.  Mutt's just automatically terminating the last 
argument for you at the end of the line.

>Even better, is there a way I could have a rule that sets just the
>foreground or just the background? E.g. if I could say
>
>color index        brightblue    default  "~N"
>color index        default       white    "~X 1-"
>
>and a message that was both new and had attachments would take the
>foreground color from the first rule but the background color from
>the second rule?

No, Mutt matches a single rule and uses that to color the line.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.mutt.org/pipermail/mutt-users/attachments/20210325/8e780d11/attachment.asc>


More information about the Mutt-users mailing list