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

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 08 Jul 2021 15:55:01 +0200

Michael Albinus <[email-masked]> writes:

>>>    • 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.

[...]

> As a test, I've renamed `tramp-unload-hook' and all
> `tramp-FEATURE-unload-hook' variables to `tramp-unload-function' and
> `tramp-FEATURE-unload-function', respectively. The related test,
> `tramp-test45-unload', fails now. I haven't debugged further, but
> throwing a warning when `FEATURE-unload-hook' is used, looks premature
> to me.

The quoted text no longer exists in Emacs 28 -- it now refers to
-unload-function.  Because:

commit 8da810f91b11a258a7ed0f5315292143072881d8
Author:     Eli Zaretskii <[email-masked]>
AuthorDate: Mon Nov 7 19:39:54 2016 +0200
Commit:     Eli Zaretskii <[email-masked]>
CommitDate: Mon Nov 7 19:39:54 2016 +0200

    Don't refer to obsolete FEATURE-unload-hook
    
    * doc/lispref/tips.texi (Coding Conventions): Refer to
    FEATURE-unload-function rather than its obsolete variant
    FEATURE-unload-hook.  (Bug#24890)

But I don't know whether -unload-function has the same problems that
-unload-hook had?  And I see that there's still a lot of things called
-unload-hook in Emacs...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no