GNU bug report logs - #76748
31.0.50; `unload-feature' unbinds NEW-ALIAS and BASE-VARIABLE of variable alias

Previous Next

Package: emacs;

Reported by: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>

Date: Tue, 4 Mar 2025 20:58:02 UTC

Severity: normal

Found in version 31.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 76748 <at> debbugs.gnu.org
Subject: bug#76748: 31.0.50; `unload-feature' unbinds NEW-ALIAS and BASE-VARIABLE of variable alias
Date: Wed, 12 Mar 2025 21:36:40 +0100
On 2025-03-05  13:33, Eli Zaretskii wrote:
>> Date: Tue, 04 Mar 2025 21:57:18 +0100
>> From:  Jens Schmidt via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>>
>> 1. `defalias' on builtin variable, like in vhdl-mode.el:
>>
>>      ./progmodes/vhdl-mode.el:2331:  (defvaralias 'vhdl-last-input-event 'last-input-event)
>>
>>    Start with "emacs -Q", then execute with C-j in *scratch*:
>>
>>      (require 'vhdl-mode)
>>      vhdl-mode
>>
>>      (unload-feature 'vhdl-mode)
>>      =>
>>      Lisp error: (error "Built-in variables may not be unbound")
>>        makunbound(vhdl-last-input-event)
>>        #f(compiled-function (x) #<bytecode -0x15f00789bdf1ec4b>)(vhdl-last-input-event)
>>        apply(#f(compiled-function (x) #<bytecode -0x15f00789bdf1ec4b>) vhdl-last-input-event nil)
>>        loadhist-unload-element(vhdl-last-input-event)
>>        unload-feature(vhdl-mode)
>>
>> 2. `define-obsolete-variable-alias' on non-builtin, like this:
>>
>>      ./net/shr.el:164:(define-obsolete-variable-alias 'shr-external-browser 'browse-url-secondary-browser-function "27.1")
>>
>>    Start with "emacs -Q", then execute with C-j in *scratch*:
>>
>>      (require 'browse-url)
>>      browse-url
>>
>>      browse-url-secondary-browser-function
>>      browse-url-default-browser
>>
>>      (require 'shr)
>>      shr
>>
>>      (unload-feature 'shr)
>>      nil
>>
>>      browse-url-secondary-browser-function
>>      => Lisp error: (void-variable browse-url-secondary-browser-function)
>>
>> My understanding is that `unload-feature' in
>>
>> case 1. tries to unbind BASE-VARIABLE of the alias, and not NEW-ALIAS,
>> and fails to do so and in
>>
>> case 2. unbinds both CURRENT-NAME and OBSOLETE-NAME.
>>
>> I would expect that in these cases `unload-feature' should unbind
>> NEW-ALIAS/OBSOLETE-NAME from the feature being unloaded, but leave
>> BASE-VARIABLE/CURRENT-NAME unchanged.  (Except of course if both items
>> of the alias originate from the same feature.)
> 
> Stefan, any suggestions?

Gentle ping to Stefan ...

... thanks!






This bug report was last modified 67 days ago.

Previous Next


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