emacs-devel
[Top][All Lists]
Advanced

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

Re: doc on define-minor-mode hook variable(s)


From: Stefan Monnier
Subject: Re: doc on define-minor-mode hook variable(s)
Date: Sun, 05 Mar 2006 16:01:42 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> exiting the mode. What's not clear from this doc is whether
> `define-minor-mode' creates a variable named `MODE-hook'.

Here is the explanation: a hook is not a *variable* but a *symbol*.
A hook has various elements, all of which happen to be currently stored in
the value part of the symbol (some in the buffer-local parts, others in the
global part).

So whether or not a variable is created is not really relevant: the symbol
is "created" and that's all that's needed.


        Stefan


PS: Yes, this means that the only way to figure out whether a hook exists or
not is by actually placing something on it and checking whether/when it
gets triggered.  That's how hooks have been defined.




reply via email to

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