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

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

Re: `font-lock-add-keywords' works... sometimes


From: Michael Heerdegen
Subject: Re: `font-lock-add-keywords' works... sometimes
Date: Tue, 19 Mar 2019 23:09:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > but not this
> >
> >     (font-lock-add-keywords 'text-mode
> >      '(
> >        ("yellow" . font-lock-function-name-face)
> >       )
> >      t) ; append [3]
>
> You'd first have to clarify what you mean by "work", but my crystal ball
> suggests that text-m,ode does not enable font-lock by default, contrary
> to message-mode.

But it should be covered by global-font-lock-mode by default.

I see that font-lock-mode is indeed enabled but `font-lock-specified-p'
fails for a text-mode buffer, so you get a buffer with font-lock-mode on
but no fontification.  Maybe using font-lock-add-keywords without
setting any other font-lock variables confuses font-lock?  An explicit
`font-lock-set-defaults' call helps btw.


Michael.



reply via email to

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