From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65209: 30.0.50; Unexpected behaviour of setq-local Date: Thu, 24 Aug 2023 08:22:35 +0300 Message-ID: <83msyhqajo.fsf@gnu.org> References: <87msyu2tmm.fsf@web.de> <80D7C281-C3DD-4DCA-9B14-1569E849CBC7@gmail.com> <87wmxqqq7d.fsf@web.de> <83350exl6h.fsf@gnu.org> <87wmxnojrb.fsf@web.de> <83msyjtkeo.fsf@gnu.org> <871qfu4dyx.fsf@web.de> <83fs4arnr1.fsf@gnu.org> <87pm3dnt9j.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24699"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, 65209@debbugs.gnu.org, monnier@iro.umontreal.ca To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 24 07:23:12 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 1qZ2oK-0006Gl-NQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Aug 2023 07:23:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ2oA-0002D4-Cc; Thu, 24 Aug 2023 01:23:02 -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 1qZ2o6-0002Cl-7M for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 01:22:59 -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 1qZ2o5-0002pU-UI for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 01:22:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZ2o9-0006Xc-Mx for bug-gnu-emacs@gnu.org; Thu, 24 Aug 2023 01:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Aug 2023 05:23:01 +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.169285454425083 (code B ref 65209); Thu, 24 Aug 2023 05:23:01 +0000 Original-Received: (at 65209) by debbugs.gnu.org; 24 Aug 2023 05:22:24 +0000 Original-Received: from localhost ([127.0.0.1]:35892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZ2nY-0006WU-4g for submit@debbugs.gnu.org; Thu, 24 Aug 2023 01:22:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZ2nW-0006WG-4c for 65209@debbugs.gnu.org; Thu, 24 Aug 2023 01:22:23 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZ2nM-0002mF-Eo; Thu, 24 Aug 2023 01:22:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Soa+JcNP8HljY+XHIrzXC+WhThusY1yvp/5t7rRPU4I=; b=i+j6ieKQ8Mqi/GKwhwNH osAUkial1APb7NI5y3Fmg714Wpmu09+ryYlwbmBYl/uLbPKK3P7XwVhvPI0HE1z7EMDmqwM8Ale3M /UXEXQ42zE3DxeR0nEKuMmZStuMnKYHv7PB81YpMTTQ/Vu7RN/MuPmQn38sHaFHpCziHl9QDYnhc5 nSe3SnJLWTco+cL0XOf2yGShEBN3gkhYrx79dXVDQz8a+CN3/imtQvlqgEypgoequSdLwQMH8YvJI Czg+Kyi+4IOaK/QUD7yjqd1KYQkM3FA2G94jH97b7DDytsP2HCmpEigUxs5Nu1lBYRKCASFhIu2NL yCxFrzrnTVKHLA==; In-Reply-To: <87pm3dnt9j.fsf@web.de> (message from Michael Heerdegen on Thu, 24 Aug 2023 03:06:32 +0200) 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:268298 Archived-At: > From: Michael Heerdegen > Cc: Eli Zaretskii , Stefan Monnier > , 65209@debbugs.gnu.org, > gerd.moellmann@gmail.com > Date: Thu, 24 Aug 2023 03:06:32 +0200 > > > IIRC this is done purposefully (the code has to work harder to get this > > semantics), but not really documented, and I can't offhand give you > > a good reason for that semantics. > > Thanks for the example. (info "(elisp) Creating Buffer-Local") says > about this case > > | Making a variable buffer-local within a ‘let’-binding for that > | variable does not work reliably, unless the buffer in which you do > | this is not current either on entry to or exit from the ‘let’. > | This is because ‘let’ does not distinguish between different kinds > | of bindings; it knows only which variable the binding was made for. > > I would really like to know a bit more than "doesn't work reliable". I don't think we should tell more about it in the manual. When the manual says "doesn't work reliably", the meaning is clear: stay away from doing that unless you know very well what you are doing. So if someone wants to use this regardless of the warning, and they don't yet "know what they are doing well enough", they should either study the code or ask some expert. Such subtleties have no place in the manual, since that would make it very large and hard to read for the majority who will indeed "stay away". > Such situations happen in real Emacs life. It's not always under the > control of the user or the programmer which variables are currently > let-bound when a buffer is created and buffer local variables might get > set. "Anything can happen" leaves me with a very uneasy feeling. Please describe such situations, where the escape (i.e. how to avoid bumping into this subtlety, by either rewriting the code or using auxiliary variables) is not clear.