[Top][All Lists]

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

Re: [PATCH] font-core: add font-lock-{enable, disable}-global-for functi

From: Stefan Monnier
Subject: Re: [PATCH] font-core: add font-lock-{enable, disable}-global-for functions
Date: Sat, 03 Jan 2015 23:30:54 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> This happened when I've been asked how to disable global-font-lock-mode
> in compile-mode buffers.  Simply replying:

>     (setq font-lock-global-modes '(not compilation-mode))

How 'bout

   (add-hook 'compilation-mode-hook (lambda () (font-lock-mode -1)))

> I also thought they could be useful for major modes which wish to
> disable GFF, but then I've discovered that all of them just do:
>     (set (make-local-variable 'font-lock-global-modes) nil)

Hmm... makes me wonder also why those modes would disable gffm.

>> Also, do you happen to know why speedbar.el does this funny dance to
>> avoid global-font-lock-mode from enabling font-lock in speedbar-mode?
> No idea, but it's not the only major mode to disable font-lock-mode.
> I assumed that was one of the use cases for the font-lock-global-modes
> variable.  I also had troubles with font-lock interacting with notmuch,
> see <http://notmuchmail.org/pipermail/notmuch/2012/012244.html>, so
> I assume there is something that breaks speedbar when font-lock is
> enabled.

But disabling gffm doesn't disable font-lock-mode, and it is easier
to really "disable" font-lock-mode: just don't set font-lock variables.


reply via email to

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