[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Font lock question
From: |
Stefan Monnier |
Subject: |
Re: Font lock question |
Date: |
Wed, 17 Mar 2021 12:46:57 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> But be aware that these approaches still won't work well if the [...]
>> thing can span multiple lines.
> Hmm, I'm afraid that is indeed possible. Perhaps I'll keep it simple and only
> font-lock the `B` part, since it can't contain any spaces and is fairly easy
> to
> do.
Can there be [...] without any `aBc`s in them and which need to be
font-lock differently?
If not (and if it shouldn't span too many lines), then I think
a MATCH-ANCHORED that just matches on the opening "[" and then uses the
PRE-MATCH-FORM to return the position of the matching "]" should work
acceptably, as long as you use `font-lock-multiline`.
Stefan