From: Spencer Baugh <sbaugh@catern.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>, Eli Zaretskii <eliz@gnu.org>
Cc: 44733@debbugs.gnu.org
Subject: bug#44733: Nested let bindings for non-local DEFVAR_PER_BUFFER variables unwind wrong
Date: Thu, 19 Nov 2020 14:21:16 -0500 [thread overview]
Message-ID: <87y2ixjgpf.fsf@catern.com> (raw)
In-Reply-To: <jwvzh3d5i2r.fsf-monnier+emacs@gnu.org>
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> (let ((left-margin 1))
>>> ;; Set this variable "pseudo-locally", inside a SPECPDL_LET_DEFAULT binding.
>>> (setq left-margin 123)
>>> (assert (eq left-margin 123))
>>> ;; Note, it's not a local variable.
>>> (assert (not (local-variable-p 'left-margin)))
>>> ;; The default value doesn't change.
>>> (assert (eq (default-value 'left-margin) 1))
>
> This is a bug, indeed. It should be 123 at this point.
That's one perspective, but it seems less consistent with the
documentation and with expected behavior. The documentation for these
variables says:
Automatically becomes buffer-local when set.
and here, we are setting it, with setq. It would seem that it should
become buffer-local, then. Indeed, that's the current behavior, that it
becomes "pseudo-buffer-local", in that the value is different in this
buffer from every other buffer. (But local-variable-p returns nil,
which is the only indication that something weird is going on.)
next prev parent reply other threads:[~2020-11-19 19:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-19 3:11 bug#44733: Nested let bindings for non-local DEFVAR_PER_BUFFER variables unwind wrong Spencer Baugh
2020-11-19 14:10 ` Eli Zaretskii
2020-11-19 14:22 ` Spencer Baugh
2020-11-19 18:17 ` Stefan Monnier
2020-11-19 19:21 ` Spencer Baugh [this message]
2020-11-19 20:23 ` Stefan Monnier
2020-11-19 20:56 ` Spencer Baugh
2020-11-19 22:14 ` Stefan Monnier
2021-10-23 10:19 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y2ixjgpf.fsf@catern.com \
--to=sbaugh@catern.com \
--cc=44733@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.