all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: steve-humphreys@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
Date: Thu, 28 Jan 2021 23:35:47 +0100	[thread overview]
Message-ID: <trinity-02e2b1d6-6181-4975-9cb2-2e7fa0bae8ef-1611873347807@3c-app-mailcom-bs02> (raw)
In-Reply-To: <trinity-aa71fb0f-7a61-46c8-981d-59d43dfb214e-1611872762727@3c-app-mailcom-bs02>

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	other threads:[~2021-01-28 22:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 23:27 Including tex commands in a list steve-humphreys
2021-01-27 23:01 ` Michael Heerdegen
2021-01-28 13:29   ` steve-humphreys
2021-01-28 14:24     ` Michael Heerdegen
2021-01-28 21:05       ` steve-humphreys
2021-01-28 21:19         ` Michael Heerdegen
2021-01-28 21:50           ` steve-humphreys
2021-01-28 22:12           ` steve-humphreys
2021-01-28 22:17             ` Christopher Dimech
2021-01-28 22:26               ` steve-humphreys
2021-01-28 22:35                 ` steve-humphreys [this message]
2021-01-29 12:05                   ` Michael Heerdegen
2021-01-29 12:57                     ` steve-humphreys
2021-01-29 14:00                       ` Michael Heerdegen
2021-01-29 20:46                         ` steve-humphreys
2021-01-29 20:56                           ` Michael Heerdegen
2021-01-29 21:01                             ` steve-humphreys
2021-01-29 21:10                             ` steve-humphreys
2021-01-30 13:36                               ` Michael Heerdegen
2021-01-29 21:45                           ` tomas
2021-01-29 21:52                             ` steve-humphreys
2021-01-29 22:24                               ` tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-02e2b1d6-6181-4975-9cb2-2e7fa0bae8ef-1611873347807@3c-app-mailcom-bs02 \
    --to=steve-humphreys@gmx.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.