emacs-devel
[Top][All Lists]
Advanced

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

Re: Derived modes and mode hooks


From: Stefan Monnier
Subject: Re: Derived modes and mode hooks
Date: Sat, 09 Mar 2013 10:56:52 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> Is this right?  If so, how can `body-of-foo-mode` forcibly overrule
> settings made in `text-mode-hook`?

It can't (well, if it really really wants to, it can add some code to
its own foo-mode-hook which is run after text-mode-hook).

A function added to a mode hook takes precedence, because it's presumably
a user choice, whereas body-of-foo-mode is the choice of code's author.

If the user doesn't want auto-fill-mode in foo-mode, she can add to
foo-mode-hook to turn auto-fill-mode off, or she can change her
text-mode-hook to test (derived-mode-p 'foo-mode) before enabling
auto-fill-mode.


        Stefan



reply via email to

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