help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing values through a variable


From: Emanuel Berg
Subject: Re: Passing values through a variable
Date: Sun, 14 Feb 2021 18:52:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

michael-franzese wrote:

>>> You have used
>>>
>>> ("_{\\([[:alnum:]]*\\)}" 1 font-lock-function-name-face)
>>>
>>> How can I pass the "1" using a variable, rather than
>>> hardwiring it?
>>
>> That's not how it works. Figure it out... or see
>> the docstring.
>
> What should I look for?

1 is the index of the subexpression that should be affected,
see this screenshot. So you search for the whole expression,
but colorize only the subexpression pointed to by the index.

See how the code corresponds to the first two lines?

   https://dataswamp.org/~incal/figures/emacs/high-low.png

If you don't have any subexpression, just a single expression
that might be as plain as a word, you don't need an index,
instead use (word . face) - I think I mentioned
this...? Nevermind.

Anyway here is an example of that:

  https://dataswamp.org/~incal/figures/emacs/dressed-up-as-themselves.png

Look at the code and think. What does the file name refer to?

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]