[Top][All Lists]

[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

On 2016-01-26, at 05:14, Stefan Monnier <> 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


Marcin Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

reply via email to

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