bug#81550: 30.2; add project-specific hooks to unload-feature-special-hooks

Eli Zaretskii <[email protected]> Tue, 04 Aug 2026 15:20:19 +0300
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
> From: Lin Jian <[email protected]>
> Cc: [email protected],  [email protected]
> Date: Tue, 04 Aug 2026 20:10:40 +0800
> 
> Eli Zaretskii <[email protected]> writes:
> 
> >> Cc: [email protected]
> >> Date: Tue, 04 Aug 2026 15:28:33 +0800
> >> From: Lin Jian via "Bug reports for GNU Emacs,
> >>  the Swiss army knife of text editors" <[email protected]>
> >> 
> >> 
> >> When supporting `unload-feature' for my project backend, I have to write
> >> a FEATURE-unload-function to clean `project-find-functions' and
> >> `project-list-exclude'.
> >> 
> >> That FEATURE-unload-function can be omitted if `project-find-functions'
> >> and `project-list-exclude' are added to `unload-feature-special-hooks'.
> >> I suggest adding them.
> >
> > Does it really happen frequently that unloading a feature affects
> > which files project.el will consider, or is that a rare corner case?
> 
> If by "a feature" you mean a random feature, then probably that random
> feature does not need to clean project-specific hooks.
> 
> However, note that I do not mean a random feature.  I mean specific
> features: project backends.  See C-h P project RET for definition of
> project backend.  These specific features always have to clean
> project-specific hooks if they decide to support `unload-feature'.

But unload-feature-special-hooks is a general hook, not limited to
project backends, is it?  Or what am I missing?