GNU bug report logs - #21440
25.0.50; Manual: FEATURE-unload-hook in (info "(elisp) Coding Conventions")

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Wed, 9 Sep 2015 11:44:02 UTC

Severity: minor

Found in version 25.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: 21440 <at> debbugs.gnu.org
Subject: bug#21440: 25.0.50; Manual: FEATURE-unload-hook in (info "(elisp) Coding Conventions")
Date: Wed, 09 Sep 2015 13:43:36 +0200
Hi,

In (info "(elisp) Coding Conventions"):

   • If loading the file adds functions to hooks, define a function
     ‘FEATURE-unload-hook’, where FEATURE is the name of the feature the
     package provides, and make it undo any such changes.  Using
     ‘unload-feature’ to unload the file will run this function.  *Note
     Unloading.


A problematic tip:

 - it is unnecessary for that reason. AFAIK FEATURE's functions are
 removed automatically from hooks by `unload-feature'.

 - When you follow the advice, `unload-feature' will skip removing
 entries from `auto-mode-alist', so you would have to do that yourself.

 - Isn't `FEATURE-unload-function' the preferred thing to use today?
 The doc string of `unload-feature' doesn't even mention
 FEATURE-unload-hook variables.  Seems it is discouraged to be used.


BTW, I miss a comment what I should do if a feature added functions to
the buffer local binding of a hook.  Does `unload-feature' take care of
that (doesn't seem so)?  Nothing about this in (info "(elisp) Unloading").


Thanks,

Michael.



In GNU Emacs 25.0.50.19 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
 of 2015-09-07
Repository revision: af629df80605614c645ba6539bb98d4f1e990925
Windowing system distributor 'The X.Org Foundation', version 11.0.11702000
System Description:	Debian GNU/Linux testing (stretch)





This bug report was last modified 3 years and 308 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.