GNU bug report logs -
#5293
23.1; unload-feature on buffer-local hooks
Previous Next
Reported by: Kevin Ryde <user42 <at> zip.com.au>
Date: Sat, 2 Jan 2010 21:07:02 UTC
Severity: minor
Merged with 34686
Found in version 26.1
Done: Štěpán Němec <stepnem <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Mon, 06 Apr 2020 22:39:50 +0200
Juanma Barranquero wrote:
> On Mon, Apr 6, 2020 at 7:24 PM Štěpán Němec <stepnem <at> gmail.com> wrote:
>
>> Actually, I wonder if ignoring even the global hooks (as opined by
>> Juanma) and enforcing more widespread usage of FEATURE-unload-function
>> wouldn't be better;
>
> Anything automatically done in the unload-hook is just an ad hoc fix
> for things the module author knows how to do better than us.
One common scenario where this doesn't quite hold IIUC is minor modes
which users are supposed to put on various hooks themselves: the library
author has no way of dealing with that, short of doing something like
`unload-feature' does, although checking for just a few known symbols
from an unload function instead of the brute-force approach of the
latter would arguably be more effective.
> FEATURE-unload-function has already been there for a few years. I
> don't remember right now whether we suggest in the mode-creation
> documentation to use it,
We do (lispref/tips.texi). Unfortunately, most elisp libraries in the
wild seem to be written by people who either haven't read it, or have
remained resistent to most of its edificatory influence.
> but certainly that's something module authors should do, and the
> automatic unloading is just a last-resort feature for those old
> modules that don't.
Actually, IME the older, the better behaved. I can't remember last time
I saw a newish package with an unload function (while I do remember
those without one which left my Emacs broken when I tried unloading
them).
> There's no point IMHO to make the hands off approach work better.
I don't know what you mean by "hands off" here, but in any case, while I
used to argue for handling as much as possible in `unload-feature',
these days I don't feel strongly about it. So even though this
particular issue (local hooks) does seem solvable (thanks again to
Stefan!) without making anything much worse or uglier than it already
is, I remain of two minds on whether it is the best thing to do or not.
--
Štěpán
This bug report was last modified 4 years and 214 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.