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: Christopher Dimech
Subject: Re: font-lock as a single command
Date: Sat, 13 Feb 2021 01:04:57 +0100

(font-lock-add-keywords MODE KEYWORDS &optional HOW)

What does the optional HOW actually do?

Regards
Christopher

> Sent: Saturday, February 13, 2021 at 11:44 AM
> From: "Emanuel Berg via Users list for the GNU Emacs text editor" 
> <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: font-lock as a single command
>
> 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]