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

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

Re: Why call font-lock-add-keywords in a mode hook?


From: Marcin Borkowski
Subject: Re: Why call font-lock-add-keywords in a mode hook?
Date: Tue, 26 Jan 2016 09:51:04 +0100
User-agent: mu4e 0.9.13; emacs 25.1.50.1

On 2016-01-26, at 05:14, Stefan Monnier <address@hidden> wrote:

>> My question: why would I want to call this function in a hook if I can
>> specify the mode in its invocation?
>
> Because the other use is fundamentally unclean, requiring
> a re-implementation of major-mode's inheritance, whereas you get it for
> free if you use nil for `mode' and call it from the mode's hook instead.

Ah, so that means that if I use a non-nil value for the `mode' argument,
say x-mode, and launch a buffer in y-mode, which derives from x-mode,
then I won't have my keywords there?

>         Stefan

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



reply via email to

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