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

From: Eli Zaretskii <[email-masked]>
Date: Tue, 12 Apr 2022 14:38:47 +0300

[Adding Stefan to the discussion.]

> From: Ignacio Casso <[email-masked]>
> Date: Tue, 12 Apr 2022 11:13:27 +0200
> 
> I was revisiting this bug report and writing a patch to correct and
> update some docstrings, both in custom.el and for `default-value',
> `set-default' and `default-boundp'. But for the last three, I'm no
> longer sure if the errors are in the implementation or the docstrings,
> since I have found more strange cases while experimenting. In a few
> words, those functions behave differently inside let bindings depending
> on whether the current buffer has or not a local value for the variable,
> which I find a little bit inconsistent. If it has, they behave as they
> "toplevel" counterparts (`default-toplevel-value',
> `set-default-toplevel-value'). If they don't, they behave as I explained
> in previous emails. I describe those cases below, with code snippets and
> comments. Note that the behavior also depends on whether lexical binding
> is enabled or not. I use dynamic binding in these examples.

Please tell more in each case where you consider the behavior
"surprising" why did you expect something different.  I think it's
important to make the subsequent discussion focused and efficient.

Thanks.