From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dave Love Newsgroups: gmane.emacs.bugs Subject: Re: the ...-unload-hook convention doesn't work Date: Tue, 06 Jan 2004 14:33:04 +0000 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <200401051824.i05IOpP07535@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1073399752 19411 80.91.224.253 (6 Jan 2004 14:35:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Jan 2004 14:35:52 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 06 15:35:48 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AdsJ9-0006LL-00 for ; Tue, 06 Jan 2004 15:35:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AdtGT-0006D7-FC for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Jan 2004 10:37:05 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AdtGJ-00066N-FR for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2004 10:36:55 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AdtFk-0005Vj-9R for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2004 10:36:51 -0500 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AdtEw-000521-4g for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2004 10:35:30 -0500 Original-Received: from [148.79.80.39] (helo=albion.dl.ac.uk) by mx20.gnu.org with esmtp (Exim 4.24) id 1AdsGp-0007oI-RF for bug-gnu-emacs@gnu.org; Tue, 06 Jan 2004 09:33:23 -0500 Original-Received: from fx by albion.dl.ac.uk with local (Exim 3.35 #1 (Debian)) id 1AdsGW-0004zd-00; Tue, 06 Jan 2004 14:33:04 +0000 Original-To: Luc Teirlinck User-Agent: Gnus/5.1005 (Gnus v5.10.5) Emacs/21.2 (gnu/linux) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:6492 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:6492 Luc Teirlinck writes: > It now is supposed to be a normal hook. From (elisp)Unloading: > > If `FEATURE-unload-hook' is defined, it is run as a normal hook > before restoring the previous definitions, _instead of_ the usual > hook-removing actions. I can't check the history now, but if it's been changed it hasn't been done properly. All the examples in Emacs are simple defuns. (I suspect various files which need the hook are missing it. I've previously updated them when I've noticed, but apparently not tested the results properly.) Granted, the naming `-hook' when it isn't a normal hook was wrong, but the idea was to only need to define a function, not a function plus a variable. I think such usage should be supported in addition to a normal hook. > But how could this have broken things? `run-hooks' is supposed to be > able to handle a single function instead of a list, so there should be > no problems with compatibility in as far as line 143 is concerned. I think you misunderstand. (progn (defun foo-func () (setq foo 'run)) (let ((foo 'not-run)) (run-hooks 'foo-func) foo)) => not-run > Are there concrete examples of problems arising from either defining > FEATURE-unload-hook as a function (even though, according to the Elisp > manual, this is now considered obsolete) or defining it as a normal > hook? Yes -- as I said, the mechanism doesn't work. You can end up with an unusable Emacs if you unload some things.