From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#44733: Nested let bindings for non-local DEFVAR_PER_BUFFER variables unwind wrong Date: Thu, 19 Nov 2020 15:23:45 -0500 Message-ID: References: <877dqikpmj.fsf@catern.com> <834kllphd8.fsf@gnu.org> <87y2ixjgpf.fsf@catern.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3299"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 44733@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 19 21:40:46 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfqjU-0000ie-9a for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Nov 2020 21:40:44 +0100 Original-Received: from localhost ([::1]:49822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfqjT-0006VB-9r for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Nov 2020 15:40:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfqTL-00047r-K7 for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2020 15:24:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kfqTJ-0005Ra-Pc for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2020 15:24:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kfqTJ-0005Oh-Kk for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2020 15:24:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Nov 2020 20:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44733 X-GNU-PR-Package: emacs Original-Received: via spool by 44733-submit@debbugs.gnu.org id=B44733.160581743820739 (code B ref 44733); Thu, 19 Nov 2020 20:24:01 +0000 Original-Received: (at 44733) by debbugs.gnu.org; 19 Nov 2020 20:23:58 +0000 Original-Received: from localhost ([127.0.0.1]:40997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfqTG-0005OR-Hu for submit@debbugs.gnu.org; Thu, 19 Nov 2020 15:23:58 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kfqTE-0005OB-Fl for 44733@debbugs.gnu.org; Thu, 19 Nov 2020 15:23:56 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 019638005E; Thu, 19 Nov 2020 15:23:51 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 46A2B80055; Thu, 19 Nov 2020 15:23:47 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1605817427; bh=eleUub42MSbyb82tovmGw5Gz3uTwBMkzG0/w0zFA5OU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=f1qwwqkkJI3PG40RvuxA3HHo2ob6RaPx92nhdO20MOvpR9X4ZPEKm2v1zkAqexyWt NyVmgyBusDVD5r+IfO/gaIKLlzDtWYE29F7YZboa1s56h10eFm7EqtQ8himuLM8BAQ o+70cGXFELO26g8OgCmfpicdjhqTE2Vf7LJyh6EHs5U94BpkVs16tNM+CbXps9nvxR cxXCcjv2EHMo58iEXdWQEDW2LLw5PQh9/pMZTSlet2cKVDqlnthzxXh7nv64/CKVlx wtDApHdLuYflmsjbpugL8T0l+RpqQ93bVpKZ50vnxIAd1N8wwplEZRmyuKJw2ijM0s 7mb20MbuGixFg== Original-Received: from alfajor (unknown [157.52.9.240]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C9659120323; Thu, 19 Nov 2020 15:23:46 -0500 (EST) In-Reply-To: <87y2ixjgpf.fsf@catern.com> (Spencer Baugh's message of "Thu, 19 Nov 2020 14:21:16 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:193743 Archived-At: >> 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. That's the way all other variables behave: (defvar-local sm-foo 1) (let ((sm-foo 23)) (setq sm-foo 45) (list sm-foo (with-temp-buffer sm-foo))) and I think it's asking for trouble if (let ((sm-foo 23)) ...) behaves differently from (let (sm-foo) (setq sm-foo 23) ...) > 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.) Indeed the current behavior is clearly buggy. Historically, the behavior of PER_BUFFER variables has been even more unlike that of `make-variable-buffer-local` but over the years, I've made efforts to make them behave the same. Clearly, I missed this spot. Stefan