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: Sat, 26 Aug 2023 09:02:15 +0300 Message-ID: <83jztimjdk.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> <83msyhqajo.fsf@gnu.org> <87h6om8shk.fsf@web.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22791"; 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 Sat Aug 26 08:03:16 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 1qZmOB-0005i4-P7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Aug 2023 08:03:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZmNw-00033c-6Z; Sat, 26 Aug 2023 02:03:00 -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 1qZmNu-000335-Az for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 02:02:58 -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 1qZmNu-0001AJ-2y for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 02:02:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZmNy-0000tm-I6 for bug-gnu-emacs@gnu.org; Sat, 26 Aug 2023 02:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Aug 2023 06:03: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.16930297243384 (code B ref 65209); Sat, 26 Aug 2023 06:03:02 +0000 Original-Received: (at 65209) by debbugs.gnu.org; 26 Aug 2023 06:02:04 +0000 Original-Received: from localhost ([127.0.0.1]:41518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZmN2-0000sV-Cz for submit@debbugs.gnu.org; Sat, 26 Aug 2023 02:02:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZmMx-0000rx-H4 for 65209@debbugs.gnu.org; Sat, 26 Aug 2023 02:02:03 -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 1qZmMm-00016S-3V; Sat, 26 Aug 2023 02:01:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3EbScUsrI2N57bTytuF8qZvYw2OiGp4mTh2oBCiXjH4=; b=JEok3gw4DWy3 hAd1CmjJiykDCkvwCYrQC3mUKYQglSybxlhOZ7FmVAaaqLimbkBlpmwp2AwNd07w1PSvLEqKaisw+ ovY2o5aSnK9w/tkFXHX1w0J3jGKp9BcUB+eHTl4Y+UlQfb+O6exUPCmxBPjp10mnNjCNVAO2RnsJn PUSvOi/m32L6V0mmIl3PI8Pf7WpWv2u5m+2bkttr5Ao/6kGsIn4gQXh08kb0X6blEWNvDAIYW4sx/ fNS+UY1b+yyq2g960LCcHxM3fO/bsTHnsoy1l1RcRW+esQQ43tccsuKCaGcOxFIFtZztcDPSK6Gjs dvdXpxKmFwiPvOCvJidaXg==; In-Reply-To: <87h6om8shk.fsf@web.de> (message from Michael Heerdegen on Sat, 26 Aug 2023 04:09:11 +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:268468 Archived-At: > From: Michael Heerdegen > Cc: monnier@iro.umontreal.ca, 65209@debbugs.gnu.org, gerd.moellmann@gmail.com > Date: Sat, 26 Aug 2023 04:09:11 +0200 > > Eli Zaretskii writes: > > > 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. > > I don't know. The problem is that when setting buffer-local variables > it is unknown which bindings are in effect unless you explicitly look. Only if you happen to write the convoluted code such as the one you show, right? Because in simple cases the results are predictable and known in advance, right? > I don't know whether something like this can happen at all. Stefan's > examples use `setq', not `setq-local', so maybe everything is just fine > after his fix of this bug. I can't tell for sure because I can't read C > very efficiently and we don't have doc describing this, so I am not > really a good person to ask. Since Stefan is quiet, let's assume the > situation is good enough now. >From where I stand, we cannot possibly include all of this in the manual. Emacs Lisp is a large and complex language, especially when the code mixes some of the advanced features in complex ways. Trying to describe all of them and all of their combinations will just make the manual harder to read. There are times when I bump into situations like that, even though I try to avoid such complex code as mush as possible (because it also increases the probability of making mistakes due to complexity). When that happens, and the blunder is not clear upon examination and debugging, I simply rewrite the code to use simpler patterns. This is my advice to anyone who bumps into these situations.