bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54399: 27.2; Problems with (let ((custom-variable ...)) (autoload-fu


From: Ignacio Casso
Subject: bug#54399: 27.2; Problems with (let ((custom-variable ...)) (autoload-function ...))
Date: Tue, 12 Apr 2022 16:27:54 +0200
User-agent: mu4e 1.6.10; emacs 29.0.50

Stefan Monnier <monnier@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]