GNU bug report logs -
#44733
Nested let bindings for non-local DEFVAR_PER_BUFFER variables unwind wrong
Previous Next
Reported by: Spencer Baugh <sbaugh <at> catern.com>
Date: Thu, 19 Nov 2020 03:12:02 UTC
Severity: normal
Fixed in version 28.1
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
> Why did you think this is a bug? The ELisp manual seems to document
> what you see:
>
> A variable can have more than one local binding at a time (e.g., if
> there are nested ‘let’ forms that bind the variable). The “current
> binding” is the local binding that is actually in effect. It determines
> the value returned by evaluating the variable symbol, and it is the
> binding acted on by ‘setq’.
>
> Or did I misunderstand what you found unexpected?
I mentioned two unexpected things, but I don't think that parapgrah
describes either of them.
First was the behavior that when you setq within a let_default binding,
the binding does not appear local when queried with local-variable-p.
That's relatively minor. It doesn't seem to me that that paragraph says
anything about "You can have local bindings which don't appear local
when queried with local-variable-p".
Second, and the more important bug, which my code example was about, is
"the default value is set to whatever your current binding is, if you
enter and then exit a nested let-binding". That seems definitely
uncovered by that paragraph, or any documentation.
This bug report was last modified 3 years and 271 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.