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 23:35:47 +0100

Have also tried to do the following, but it still has remained a problem.

(defconst crucible-mtksy-keywords
  `(;; Greek
    (,(concat "\\\\\\<"
              (rx "\\" "alpha" (or "beta" "chi") "delta")
                 "\\>")
     (0 'crucible-mtksy-tfc)) ; NOTE: Use 0 instead of 1 to also highlight the \
    (,(concat "\\\\\\<\\(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))




> Sent: Friday, January 29, 2021 at 10:26 AM
> From: steve-humphreys@gmx.com
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> Subject: Re: Including tex commands in a list
>
> As you pointed out, I misunderstood how to use rx.
>
> However when I applied the change, the keywords are not being
> highlighted at all.
>
>   `(;; Greek
>     (, (rx "\\" "alpha" (or "beta" "chi") "delta")
>      (1 'crucible-mtksy-tfc))
>     (,(concat "\\\\\\<\\(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))
>
>
> > Sent: Friday, January 29, 2021 at 10:17 AM
> > From: "Christopher Dimech" <dimech@gmx.com>
> > To: steve-humphreys@gmx.com
> > Cc: "Michael Heerdegen" <michael_heerdegen@web.de>, help-gnu-emacs@gnu.org
> > Subject: Re: Including tex commands in a list
> >
> > You can try to use
> >
> > (require 'rx)
> > (rx "\\" "alpha" (or "beta" "gamma") "theta")
> >
> >
> >
> >
> > > Sent: Friday, January 29, 2021 at 10:12 AM
> > > From: steve-humphreys@gmx.com
> > > To: "Michael Heerdegen" <michael_heerdegen@web.de>
> > > Cc: help-gnu-emacs@gnu.org
> > > Subject: Re: Including tex commands in a list
> > >
> > > I know that the command
> > >
> > > (rx (or "alpha" "beta"))
> > >
> > > produces the generated pattern
> > >
> > > "\\(?:alpha\\|beta\\)"
> > >
> > >
> > >
> > >
> > >
> > > > Sent: Friday, January 29, 2021 at 9:19 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 using font lock to highlight keywords in a minor mode.
> > > > > Have changed from using "concat" to using "rx" as you suggested.
> > > > > However it does not seem equivalent.
> > > > >
> > > > > (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)))
> > > > >  "Fontification for letters and symbols.")
> > > >
> > > > How does your rx version look like?
> > > >
> > > > Michael.
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



reply via email to

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