[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: Michal Nazarewicz
Subject: Re: [PATCH] font-core: add font-lock-{enable, disable}-global-for functions
Date: Sun, 04 Jan 2015 07:07:45 +0100
User-agent: Notmuch/0.19~rc1+1~g03aea4f (http://notmuchmail.org) Emacs/ (x86_64-unknown-linux-gnu)

On Sat, Jan 03 2015, Stefan Monnier <address@hidden> wrote:
>> 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)))

So what is font-lock-global-modes for anyway?  If a hook is the best way
to disable font-lock-mode, what does font-lock-global-modes give us?

>> 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.
>         Stefan

Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<address@hidden>--<xmpp:address@hidden>--ooO--(_)--Ooo--

reply via email to

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