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

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

Re: font-lock as a single command


From: Emanuel Berg
Subject: Re: font-lock as a single command
Date: Sat, 13 Feb 2021 00:44:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Christopher Dimech wrote:

> I want to construct the font-lock as a single command
>
> (font-lock-add-keywords nil ...)
>
> But I am unsure how to do it.

I believe you :)

> (defconst supinf-font-lock-cruc
>   (append
>      '((supinf-match
>           (1 (supinf-raise-cruc (match-beginning 0))) )))
>   "Experimental expressions to highlight in TeX modes.")

?

Here is how to add a single word to Elisp mode:

(font-lock-add-keywords 'emacs-lisp-mode
 '(
   ("lamersRus" . font-lock-builtin-face)
   )
 t)

> (defun supinf-enable ()
>   "Enables a typeface for displaying tex commands."
>   (setq supinf-signal t)
>   (font-lock-add-keywords nil supinf-font-lock-cruc t))

M-x font-lock-mode RET

or (font-lock-mode 'toggle)

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

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