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: michael-franzese
Subject: Re: Passing values through a variable
Date: Sun, 14 Feb 2021 19:08:37 +0100



The oricinal code used either a "0" or a "1".  With "0", the leading
"\" is highlighted; whereas with "1", the leading "\" is not highlighted.

  (defconst comseq-list
  `(
    (,(rx "\\" word-start (group (or "alpha" "beta" "chi" "delta")) word-end)
     (1 'colour-texcmd-crucible))

> Sent: Monday, February 15, 2021 at 5:52 AM
> From: "Emanuel Berg via Users list for the GNU Emacs text editor" 
> <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Passing values through a variable
>
> 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]