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: Xue Fuqiao
Subject: Re: Derived modes and mode hooks
Date: Sat, 9 Mar 2013 22:31:53 +0800

On Sat, 9 Mar 2013 15:06:00 +0100
Sebastian Wiesner <address@hidden> wrote:

> For instance, given "foo-mode" defined as:
> 
> (define-derived-mode foo-mode text-mode "Foo"
>   "A useless mode for demonstration purposes"
>   (body-of-foo-mode))

> Then "M-x foo-mode" will

> 1. Perform some standard setup stuff (e.g. killing local variables,
> setting the key map, etc.)
> 2. Execute "body-of-foo-mode"
> 3. Execute all hooks in "text-mode-hook"
> 4. Execute all hooks in "foo-mode-hook"

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

See the function `run-mode-hooks'.  I'm no expert on this, but IIRC
`after-change-major-mode-hook' helps.

-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao



reply via email to

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