GNU bug report logs -
#54399
27.2; Problems with (let ((custom-variable ...)) (autoload-function ...))
Previous Next
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
Message #64 received at 54399 <at> debbugs.gnu.org (full text, mbox):
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 there's no buffer-local value and `default-value` operates in the
> buffer-local dimension, why do you expect it to return a different value
> from `symbol-value`?
>
>
> Stefan
Probably because I don't really understand all the concepts involved
here. But I expect functions that operate on the default value of the
buffer-local dimension to behave the same way regardless of whether the
current buffer happens to have actually a local value. So if
`default-value' returns something different as `symbol-value' when there
is a buffer-local value, I expect the same to occur when there is no
buffer-local value.
But never mind, I just wanted to ensure that the current behavior was
the expected one before updating the docstring for `default-boundp', and
you already confirmed that. And this is an uncommon corner case for
which I can't think of real use cases, aside from the one of autoloading
inside a let binding of a variable a file which defines that (custom)
variable, for which we are already using `default-toplevel-value' and
`set-default-toplevel-value'. So let's leave it at that.
This bug report was last modified 2 years and 343 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.