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

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

Re: Including tex commands in a list


From: Michael Heerdegen
Subject: Re: Including tex commands in a list
Date: Thu, 28 Jan 2021 00:01:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

steve-humphreys@gmx.com writes:

> I am including a long list of greek characters (\alpha \beta \gamma)
> when using texinfo, and want to inquire how to list them in a
> multiline expression.  Here I am using one line.
>
> (defconst supinf-greek-keywords
>   '(("\\\\\\<\\(alpha\\|beta\\|gamma\\)\\>"
>      (1 'typeface-greek-keywords)))
>   "Rules to apply font-lock highlighting.")

You mean, in the expression?  Like

#+begin_src emacs-lisp
(defconst supinf-greek-keywords
  `((,(concat "\\\\\\<\\("
              (mapconcat #'identity (list "alpha" "beta" "gamma") "\\|")
              "\\)\\>")
             (1 'typeface-greek-keywords)))
  "Rules to apply font-lock highlighting.")
#+end_src

?

It would be best to use an appropriate `rx' expression instead of
`concat' as above if you know `rx' or want to get used to it.  Would
make the result even more readable.

Regards,

Michael.




reply via email to

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