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

From: Ignacio Casso <[email-masked]>
Date: Tue, 12 Apr 2022 15:23:53 +0200

Stefan Monnier <[email-masked]> writes:

>>   (setq lexical-binding nil)
>>   (let ((another-fresh-var 1))
>>     (default-boundp 'another-fresh-var)) ;; I expect nil, it returns t
>
> This means you misunderstand dynamic scoping or the meaning of
> "default-" in `default-boundp` (it has nothing to do with let bindings
> but is only concerned about buffer-local or not).

I know, but the docstring for default-boundp in Emacs 29 says:

"A variable may have a buffer-local or a ‘let’-bound local value.  This
function says whether the variable has a non-void value outside of the
current context"

So that docstring at least should be corrected, and either restore the
docstring in Emacs 27, that does not mention let bindings at all, or
clarify the distinction in that docstring an also in the docstrings for
`default-value' and `set-default'