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: steve-humphreys
Subject: Re: Including tex commands in a list
Date: Thu, 28 Jan 2021 14:29:26 +0100

Never came across rx before.

Have used

(defconst crucible-mtksy-keywords
  `(;; Greek
    (,(concat "\\\\\\<\\(alpha\\|beta\\|chi\\|delta\\|"
              "Delta\\|epsilon\\|varepsilon\\|eta\\|"
              "gamma\\|Gamma\\|iota\\|kappa \\|"
              "lambda\\|Lambda\\|mu\\|nu\\|"
              "omega\\|Omega\\|phi\\|varphi\\|"
              "Phi\\|pi\\|varpi\\|Pi\\|"
              "psi\\|Psi\\|rho\\|varrho\\|"
              "sigma\\|varsigma\\|Sigma\\|tau\\|"
              "theta\\|vartheta\\|Theta\\|upsilon\\|"
              "Upsilon\\|xi\\|Xi\\|zeta\\)\\>")
     (0 'crucible-mtksy-tfc)) ;

It would help if I had an example of using "rx" for this.

> Sent: Thursday, January 28, 2021 at 11:01 AM
> From: "Michael Heerdegen" <michael_heerdegen@web.de>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Including tex commands in a list
>
> 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]