From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#65209: 30.0.50; Unexpected behaviour of setq-local Date: Fri, 11 Aug 2023 07:53:18 +0200 Message-ID: <87h6p6dt0x.fsf@web.de> References: <953357c8-83b4-5d7f-7638-e79382ad164c@gmail.com> <87zg2yfn53.fsf@web.de> <2c06d6df-dd6d-78c4-f4dd-44cac8d95d84@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29591"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 65209@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 11 07:54:26 2023 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 1qUL6O-0007Z1-S7 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Aug 2023 07:54:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUL63-0002xo-Re; Fri, 11 Aug 2023 01:54:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qUL62-0002xe-KY for bug-gnu-emacs@gnu.org; Fri, 11 Aug 2023 01:54:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qUL62-0002aA-Bn for bug-gnu-emacs@gnu.org; Fri, 11 Aug 2023 01:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qUL62-0006w0-7o for bug-gnu-emacs@gnu.org; Fri, 11 Aug 2023 01:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Aug 2023 05:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65209 X-GNU-PR-Package: emacs Original-Received: via spool by 65209-submit@debbugs.gnu.org id=B65209.169173321026609 (code B ref 65209); Fri, 11 Aug 2023 05:54:02 +0000 Original-Received: (at 65209) by debbugs.gnu.org; 11 Aug 2023 05:53:30 +0000 Original-Received: from localhost ([127.0.0.1]:44721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUL5V-0006v6-SP for submit@debbugs.gnu.org; Fri, 11 Aug 2023 01:53:30 -0400 Original-Received: from mout.web.de ([212.227.15.4]:56371) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUL5S-0006us-Py for 65209@debbugs.gnu.org; Fri, 11 Aug 2023 01:53:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1691733199; x=1692337999; i=michael_heerdegen@web.de; bh=FtkIgin0tTIS63pp0xsmksr5gDsdaYaX1ZWTpZXtl4I=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=IV7Lv9upYVSdrhnQdSTBOLCeiVOco8gv6JbRcpUJMhUqQ9t6yceTooOncQRMsshJObeQ5Hs SP0ZW8T/ktKzej3nT+MwkZloEqU7Q4HFDnrcK4sIH/E0WOtudMrk14ZiYTe8PjgEUgE1E+z3K xj5mUC23Irq5dUUqhkoBKOFEVkxwz8JPS3tYtSZjK9Pp4emW/WjEnBCpSFiy3NzvGToY4SVaw LtZTtxKTiuUEwL+ChGdMofR/+0p7Ro73JyWsLJxvOuM5JwCSv+gnvqSuE/XMmkI39X0aFdFaL mwbuQDtgfYZYudYwduLSMB38LKmzf9j7ppvFfcN/U8bs/IZq/86Q== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([92.75.138.214]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MFs1z-1qa9ia34oh-00HZU2; Fri, 11 Aug 2023 07:53:19 +0200 In-Reply-To: <2c06d6df-dd6d-78c4-f4dd-44cac8d95d84@gmail.com> ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "Fri, 11 Aug 2023 06:56:01 +0200") X-Provags-ID: V03:K1:psPnt9vUMYIAqQJdWP/Sl6I/omTKqEATeQQbMmcFbfD6XvZkRVT Mlh7UWJUibGBwdTpTurNjFbEMwaov8bgwnRRNGcSU7fjuR06Jout/GbMkyVzCsoiEWCBm0I +SYK2X7h6OwlKaNg7NeJGbqJX6UyBI0ZUAuQYma0IO3VmLhHJ3cG7KvRnGNP9LKvKzBgh8N aIjCff8uxE4U6cmw6GXRA== UI-OutboundReport: notjunk:1;M01:P0:JFuRC3ZQxCU=;0u3Nt3PwX1EuTxZ80KLQGwtR1bj ntTuvTIG+di5yR1vWvsgUkLp6IIHbtAWHBEeJFo/b9ojBzKnZ/8awh9da/NBPkrWTJb+Cr96Q VtYo53eyvYDNq3CDUupj6nz2yHR+aJSm+jkTiwSYnAoM6KtSLA04P5uohQLMPtaKg4lXxQwd4 Qvxy0HX/Ptu5yhZfQ8vBK3G3SitRWrnr4wIeU6t0UYfOStql+G1tHyD+GVksf5nvVPnWKIR+F c/lB078/+pEDVheAkNWDrz14nu0yzt4udjJVJErpUDSlVtFtY22UixMX/Z/gwKmsmMnic2Oj4 Mh2BFPaaGjS4Mp+qoQlGXulEfoJ1h7J+XUwr7o9Ki1f6h0dHuo2oSFBxwgcciarEfHwiGhucZ 9yolnyHk/g+jxhTluPfWHVXmWGTy+e5pmMHo1WP95GjnLKzyNt5HlpzoeSpbkcL/Vi32lBUHW lkpSmAxjAiwUqeVc6jutTc4/s2boGF98fTkqf+epcV0MbUnccb2wcFtnt0LIepZYLMZorlkbl XOaI+cmJJpl85ZuQbe8bEbGXfYWicOMM0X1zHYgFJJ0m8nzN85WfnoHThcf1csNP/RwmVRIYF D76AK4oJ+O/KKswdeaib4l6GXlsIHURTt2O9NgCn+rGLCopN+dAkSPxYiBt0q/+DanrRhuA/N +QZ7H415/cBga4w3uBlncodndvvOQmzBt1TSx0ezhxfE5+6csjBKue8AsATpC/f0wkD8dr8Ve HBJuv/qJOZUXoHsbkZuiyXc9MvGgS2u9pTjNV+4ZkAKZch7FH/5HemiTZSRhEXeCnttN9uZF 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267185 Archived-At: Gerd M=C3=B6llmann writes: > That's right, but here's what the docs say about setq-local: > > -- Macro: setq-local &rest pairs > PAIRS is a list of variable and value pairs. This macro creates a > buffer-local binding in the current buffer for each of the > variables, and gives them a buffer-local value. It is equivalent > to calling =E2=80=98make-local-variable=E2=80=99 followed by =E2=80= =98setq=E2=80=99 for each of the > variables. > > In my first example, setq-local doesn't create a buffer-local > binding. In the second example, it doesn't set a buffer-local value. > So setq-local doesn't what the first sentence of the doc says it does. I think it does - it's only that `let' restores the old value. > > The second sentence of the doc says something quite different than the > first sentence because setq in the presence of a let-binding of course > sets the value of the let-binding. I don't think this is what is happening. E.g. #+begin_src emacs-lisp (progn (defvar my-var :default-value) (let ((my-var :let-value)) (make-local-variable 'my-var) (setq my-var :buffer-local-new)) (list my-var (local-variable-p 'my-var))) ;; (:buffer-local-new t) #+end_src `setq' sets the buffer local binding, not the global value the `let' binding refers to. > I mean, the let-binding which changes the behaviour of > lisp-interaction-mode in my case could be anywhere. It's kind of like > a spooky action at a distance. A different perspective on your recipe could also be: it changes the value of a variable that controls evaluation of a buffer while evaluating the contents of the buffer. Probably not a good idea. > Good luck debugging something like that. The same can happen if you `setq' a global binding that happens to be undone by a surrounding `let'. Or that is `setq'd again by other code. Michael.