unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Passing values through a variable
@ 2021-02-14  1:46 michael-franzese
  2021-02-14  3:39 ` michael-franzese
  0 siblings, 1 reply; 11+ messages in thread
From: michael-franzese @ 2021-02-14  1:46 UTC (permalink / raw)
  To: Help Gnu Emacs

I want to change the expression (1 'texcmd-colour) so that
the value 1 can be set through a variable (e.g. stdhl).

Can I just do

(defvar-local stdhl 1
  "Uses standard highlighting for keywords when set to 1.
When stdhl is 0, the leading backslash is also highlighted.")

(defconst tex-keywords
  `(
    ;; Greek.  Use (0 'texcmd-colour) to highlight the leading "\".
    (,(rx "\\" word-start (group (or "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")) word-end)
     (stdhl 'texcmd-colour))

(font-lock-add-keywords nil comseq-crucible t)


Below is the original code

(defconst tex-keywords
  `(
    ;; Greek.  Use (0 'colour-tex-cruc) to highlight the leading "\".
    (,(rx "\\" word-start (group (or "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")) word-end)
     (1 'texcmd-colour))

(font-lock-add-keywords nil tex-keywords t)



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-02-14 18:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-14  1:46 Passing values through a variable michael-franzese
2021-02-14  3:39 ` michael-franzese
2021-02-14  3:56   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-14  4:14     ` michael-franzese
2021-02-14  4:32       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-14 17:18         ` michael-franzese
2021-02-14 17:52           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-14 18:08             ` michael-franzese
2021-02-14 17:40         ` michael-franzese
2021-02-14 17:52           ` michael-franzese
2021-02-14 18:02             ` Emanuel Berg via Users list for the GNU Emacs text editor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).