GNU bug report logs - #54399
27.2; Problems with (let ((custom-variable ...)) (autoload-function ...))

Previous Next

Package: emacs;

Reported by: Ignacio Casso <ignaciocasso <at> hotmail.com>

Date: Tue, 15 Mar 2022 15:53:02 UTC

Severity: normal

Tags: moreinfo

Found in version 27.2

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ignacio Casso <ignaciocasso <at> hotmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: michael_heerdegen <at> web.de, Eli Zaretskii <eliz <at> gnu.org>, 54399 <at> debbugs.gnu.org, larsi <at> gnus.org
Subject: bug#54399: 27.2; Problems with (let ((custom-variable ...)) (autoload-function ...))
Date: Tue, 12 Apr 2022 16:27:54 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>>> ;; default defined, buffer-local undefined
>>> (defvar var1 "default")
>>> (let ((var1 "inside let")) (default-value 'var1)) ;; returns "inside let"
>>> 
>>> ;; default defined, buffer-local defined
>>> (defvar var2 "default")
>>> (setq-local var2 "buffer-local")
>>> (let ((var2 "inside let")) (default-value 'var2)) ;; returns "default"
>>
>> I would expect both snippets to return the same.
>
> That's because you expect the "default" in `default-value` refers to the
> let-nesting dimension rather than the buffer dimension.

No, I just expect to refer to any of those consistently, I don't mind
which one. If it's the buffer dimension, even inside let bindings, both
forms should return "default". If inside let bindings the buffer
dimension is "eclipsed", both should return "inside let". If
`default-value' inside a let binding just has undefined behavior, it
should produce an error, or at least be documented somewhere.

But right now is neither of those, and it just depends of whether the
current buffer actually has a local value for the variable, which I find
inconsistent.




This bug report was last modified 2 years and 342 days ago.

Previous Next


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