[Top][All Lists]

[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: Mon, 06 Mar 2006 00:05:04 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> I think the main thing is to clearly explain what you explained: how hooks
> work. That is not specific to `define-minor-mode'. The place to explain it,
> in both the Emacs-Lisp manual and the Emacs manual, is in node Hooks. In my
> copy of the manuals (perhaps not up to date), what you explained is not
> presented, AFAICS. The Elisp manual Hooks node starts like this: "A "hook"
> is a variable...". The Emacs manual Hooks node starts by saying "A hook is a
> Lisp variable...".

> In the past, hook variables were used, and the new notion that a hook need
> not be associated with a variable should be explained in the doc.

I'm not so sure.  After all, they *are* associated with a variable (whatever
that means).  I think the important thing is to insist on the fact that
hooks are some abstract concept and that you refer to them with symbols and
you manipulate them with add-hook and remove-hook.

But I don't intend to rewrite this part of the manual(s) and I'm sure some
other people will find my point of view unholy.

> You used "hook exists", but that seems inaccurate also, since whether or
> not a symbol exists has nothing to do with whether or not its symbol-value
> is a list of functions usable as a hook.

A hook exists if its symbol is passed to `run-hooks' or
something equivalent.

> I'd be tempted to speak in terms of the hook being empty or not.

Seems like a bad idea: it's rarely useful to know whether it's empty or not.

> Should there be a command that lets a user know whether or not a hook is
> empty - that is, a command that does simply (symbol-value 'the-hook)? Users
> need to be able to determine this sometimes,

Why would they need to know whether it's empty?
AFAIK they generally want to know whether it exists (the answer often lies
in docstrings, documentation, or when all else fails source-code).


reply via email to

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