GNU bug report logs - #34686
26.1; unload-feature doesn't remove functions locally from hooks

Previous Next

Package: emacs;

Reported by: Braun Gábor <braungb88 <at> gmail.com>

Date: Thu, 28 Feb 2019 16:21:02 UTC

Severity: minor

Merged with 5293

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


Message #14 received at 34686 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Braun Gábor <braungb88 <at> gmail.com>
Cc: 34686 <at> debbugs.gnu.org
Subject: Re: bug#34686: 26.1;
 unload-feature doesn't remove functions locally from hooks
Date: Thu, 28 Feb 2019 20:38:11 +0100
(please donʼt drop the bug address from the CC)

Braun Gábor <braungb88 <at> gmail.com> writes:

> Hi,
>
>> > Standard unloading activities include restoring old autoloads for
>> > functions defined by the library, undoing any additions that the
>> > library has made to hook variables or to ‘auto-mode-alist’[...]
>
> Obviously, this part of the docstring of unload-feature contradicts
> the info manual.
>  
>> In "(elisp) Unloading" it says:
>> 
>>      Before restoring the previous definitions, ‘unload-feature’ runs
>>      ‘remove-hook’ to remove functions in the library from certain
>>      hooks.  These hooks include variables whose names end in ‘-hook’
>>      (or the deprecated suffix ‘-hooks’), plus those listed in
>>      ‘unload-feature-special-hooks’, as well as ‘auto-mode-alist’.  This
>>      is to prevent Emacs from ceasing to function because important
>>      hooks refer to functions that are no longer defined.
>> 
>> and a quick look at the code confirms that it at least *tries* to do
>> that.
>
> And as far as I understand the code, it does remove functions from the 
> global value of the hooks, but not from the buffer-local values.
>
> IMHO, the stated reason in the info manual (keep Emacs functioning) 
> justifies removing functions from the hooks (both their global and local 
> values) which become undefined.

Yes, Iʼd tend to agree. Would you have a patch to offer?

Thanks

Robert




This bug report was last modified 4 years and 213 days ago.

Previous Next


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