From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: doc on define-minor-mode hook variable(s) Date: Mon, 06 Mar 2006 00:05:04 -0500 Message-ID: <87r75gkwbd.fsf-monnier+emacs@gnu.org> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1141621529 12918 80.91.229.2 (6 Mar 2006 05:05:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 6 Mar 2006 05:05:29 +0000 (UTC) Cc: Emacs-Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 06 06:05:28 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FG7uN-0007Wp-69 for ged-emacs-devel@m.gmane.org; Mon, 06 Mar 2006 06:05:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FG7uV-0005aR-T1 for ged-emacs-devel@m.gmane.org; Mon, 06 Mar 2006 00:05:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FG7uI-0004rL-5x for emacs-devel@gnu.org; Mon, 06 Mar 2006 00:05:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FG7uE-0004PF-M4 for emacs-devel@gnu.org; Mon, 06 Mar 2006 00:05:17 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FG7uE-0004P6-Jo for emacs-devel@gnu.org; Mon, 06 Mar 2006 00:05:14 -0500 Original-Received: from [209.226.175.25] (helo=tomts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FG7wO-0006Gu-LA for emacs-devel@gnu.org; Mon, 06 Mar 2006 00:07:28 -0500 Original-Received: from alfajor ([70.48.80.201]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060306050504.MMDI18394.tomts5-srv.bellnexxia.net@alfajor>; Mon, 6 Mar 2006 00:05:04 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id B0095D7304; Mon, 6 Mar 2006 00:05:04 -0500 (EST) Original-To: "Drew Adams" In-Reply-To: (Drew Adams's message of "Sun, 5 Mar 2006 16:40:46 -0800") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:51274 Archived-At: > 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). Stefan