Subject: Re: bug#44733: Nested let bindings for non-local DEFVAR_PER_BUFFER variables unwind wrong

From: Stefan Monnier <[email-masked]>
Date: Thu, 19 Nov 2020 13:17:51 -0500

>> (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.

>>   (with-temp-buffer (assert (eq left-margin 1)))

Same here, it should be 123.

        Stefan