From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 21 08:45:24 2025 Received: (at submit) by debbugs.gnu.org; 21 Feb 2025 13:45:24 +0000 Received: from localhost ([127.0.0.1]:57272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tlTLH-000651-Kq for submit@debbugs.gnu.org; Fri, 21 Feb 2025 08:45:24 -0500 Received: from lists.gnu.org ([2001:470:142::17]:59858) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tlTLE-00060M-O3 for submit@debbugs.gnu.org; Fri, 21 Feb 2025 08:45:21 -0500 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 1tlTL5-0008PQ-KC for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2025 08:45:11 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tlTL3-0005AX-HI for bug-gnu-emacs@gnu.org; Fri, 21 Feb 2025 08:45:11 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7DBA3441855; Fri, 21 Feb 2025 08:45:06 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1740145505; bh=/3ppvkVWm6REuQen+KrDqr+BKH8POaDf5SrhhSlFQGU=; h=From:To:Subject:Date:From; b=TuWnAEFegdr4WjlErheGR/HEUbk950d7IenImT2M93VYH3HI2w9whXR0OZrROY42X yCuKZKIw9wZIkxmpk1w54+PMco4cJ937sa2dJvKjJSnIG84RYhw5kIwi3qhFM/6KJK h/HxgVVfFRg8N1pcDA1xSYsHnOUDY4l9gc3Vo7Ann/Xouh3ZvngNmfw506hI4RALy8 lLoGGZSE9U27H2bWoxnjP2o+Qvn1WLR2XRHrFsGCTTKnYhHqnNR7gxvfoKjB3ilq5g 24XOqt8TUXpEWVPQiaCTskAq9pplK9xZPBU0HB2gZxq0WhwoXEv3XWqB7+rV9CpYPL lNUS7IW9qF+yg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 28344441812; Fri, 21 Feb 2025 08:45:05 -0500 (EST) Received: from pastel (unknown [104.247.242.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0A8FC12055D; Fri, 21 Feb 2025 08:45:05 -0500 (EST) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Subject: 31.0.50; `setq-local` makes the var buffer-local too soon Message-ID: X-Debbugs-Cc: monnier@iro.umontreal.ca Date: Fri, 21 Feb 2025 08:45:03 -0500 MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.518 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Package: Emacs Version: 31.0.50 Po Lu has just pointed me to a bug in `setq-local` which shows up when you do something like: (setq-local my-foo (progn (defvar my-foo 1000) my-foo)) Commit afd088bd608 added a workaround for exactly this problem in one of the uses of `setq-local`. The problem is that `setq-local` does, fundamentally (make-local-variable 'my-foo) (let ((val (progn (defvar my-foo 1000) my-foo))) (setq my-foo val) so that during the computation of `val`, the variable has already been made buffer-local but has not yet been assigned. So the `defvar` will correctly define the default value of `my-foo` but `my-foo` will still be unbound in the current-buffer. I suggest we change the ordering to: (let ((val (progn (defvar my-foo 1000) my-foo))) (make-local-variable 'my-foo) (setq my-foo val) As for how to implement that fix. The simplest way is to just change the macro, of course. But maybe a better way is to do it by introducing a `set-local` function (sibling to `set` and `set-default`) and then make the macro expand to a call to this function. When I discussed this with Po Lu he felt this was a risky subtle change which would interfere with a lot of code. I was quite surprised at this reaction because my own gut feeling is that, while it is undoubtedly a subtle change, it's just a very straightforward bug-fix, highly unlikely to introduce problems. WDYT? Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 21 12:02:03 2025 Received: (at 76470) by debbugs.gnu.org; 21 Feb 2025 17:02:03 +0000 Received: from localhost ([127.0.0.1]:34219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tlWPZ-000823-7t for submit@debbugs.gnu.org; Fri, 21 Feb 2025 12:02:03 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:42199) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tlWPU-0007op-Id for 76470@debbugs.gnu.org; Fri, 21 Feb 2025 12:01:58 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-38f5fc33602so1340164f8f.0 for <76470@debbugs.gnu.org>; Fri, 21 Feb 2025 09:01:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740157310; x=1740762110; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=3JAelmCcaBlaangTBoLwQ1JC8XPe0tVMGN4X9C4TLS0=; b=UrbHQgElK/v5cCoNl8t2QnlwOwfiJV2Z7kHBF3wpcFVCHvzdxAC+sIFv1Fu0XAUnUm Nq25DjQwqOIkELsBtF4pS4h6nn/lZSa05FgV0vczyRmNOzFSyCTRmqvJry0xHD5+AxD7 jU5X1agOYlTYhDpKqDfUYODgggtEccouHcFTI+DZAElNsI+Rna+UdeH+6PSZtkiUzveo WoMzi3soIuPJRe+KhpLgcp2AjLMBxGq572femdPa+1DdaRbmxK60ZC2rmXBtV+OwXrmz WAxQyDBDMBld1HCmOKD/kZRkG3a/wv2YRyGh0YkstFG5dHkobuIxDvJVMGhGA2NLumGi 386Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740157310; x=1740762110; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3JAelmCcaBlaangTBoLwQ1JC8XPe0tVMGN4X9C4TLS0=; b=OPeCpi9mfCVqpYBxaq1mJigWuzbjIvJSCbkDreZvJVNw9mnN30cCm2uHv8y9n2VDkb jBamIF/G2umsvacuZ9hOicN/q/Sre0a5ggBD2RjfXO8lkXmR73zuzylFQOFulrz0QaYH 44pG4PCvXSG1CaAGidq0XFacpru+jjPRiTwa7TSMWBdYlLoJwo9qKnoSUiWOnWDbNGjL d79gnFQhNBVaoDQ/+UGzvn8BZsDB5JiU4sY8KI7Wpcjtbub5BW0rGhfYjJcxJ9DNK7YO P7uwRaziBYkwRN0QCdyoPKz/CGMVNUojcN89njo/eHG7WkH7U4mHt+Rf0fIcPh9G5nHc D+bQ== X-Gm-Message-State: AOJu0YxSxHtfpd9r/UfpIVu8XzT3YEZ1TUbHHYvTkZO3ai3BU6eVyspj 8zkileDkX+KSKu2zZZQuJtQHoN9+2FTEjPSIKWgWj4Lddu1GMN/dgoK0XOJHqItFbLQ2j1SD5xj MVoLtKGWaDEiiviiIhwQKEsO6WrR2cEy5W0E= X-Gm-Gg: ASbGncugQHQPJiju+115UdqtsS7PCQ5G+NfaW4IdZH6n9dWkG2ex6keAZ67NKVQscez mEVClxqOiwmTCg0FWUk/KVuRDL3jQfonKLIaGf6xdUd2vK4tCBDiq9Yx1FMjUchi0/oXvTWsqg+ Jl3juHm4c= X-Google-Smtp-Source: AGHT+IGqiWZljJEfrVeMbAOZnvZsawW0Q3J0m1dtHO9YP1IzAhHs6F8m7xskLVWmZlABAOsw2tHZ7m+Ztx5i2BxeMpo= X-Received: by 2002:a5d:47c3:0:b0:38d:d59c:c9d6 with SMTP id ffacd0b85a97d-38f61611400mr7400816f8f.21.1740157309851; Fri, 21 Feb 2025 09:01:49 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 21 Feb 2025 17:01:48 +0000 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Fri, 21 Feb 2025 17:01:48 +0000 X-Gm-Features: AWEUYZkMMEfNpyJ6ygLa33xnyDY2wpN5T-5tPPK6VseXHChZkok7Uhnyt_m7laE Message-ID: Subject: Re: bug#76470: 31.0.50; `setq-local` makes the var buffer-local too soon To: 76470@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76470 Cc: monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Po Lu has just pointed me to a bug in `setq-local` which shows up when > you do something like: > > (setq-local my-foo (progn (defvar my-foo 1000) my-foo)) > > Commit afd088bd608 added a workaround for exactly this problem in one of > the uses of `setq-local`. > > The problem is that `setq-local` does, fundamentally > > (make-local-variable 'my-foo) > (let ((val (progn (defvar my-foo 1000) my-foo))) > (setq my-foo val) > > so that during the computation of `val`, the variable has already been > made buffer-local but has not yet been assigned. So the `defvar` will > correctly define the default value of `my-foo` but `my-foo` will still > be unbound in the current-buffer. > > I suggest we change the ordering to: > > (let ((val (progn (defvar my-foo 1000) my-foo))) > (make-local-variable 'my-foo) > (setq my-foo val) > > As for how to implement that fix. The simplest way is to just change > the macro, of course. But maybe a better way is to do it by introducing > a `set-local` function (sibling to `set` and `set-default`) and then > make the macro expand to a call to this function. What are the benefits of adding a new function instead of just changing the macro? > When I discussed this with Po Lu he felt this was a risky subtle change > which would interfere with a lot of code. I was quite surprised at this > reaction because my own gut feeling is that, while it is undoubtedly > a subtle change, it's just a very straightforward bug-fix, highly > unlikely to introduce problems. > > WDYT? I agree that we should fix the bug. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 23 16:54:33 2025 Received: (at 76470) by debbugs.gnu.org; 23 Feb 2025 21:54:33 +0000 Received: from localhost ([127.0.0.1]:37105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tmJvl-0000xN-GD for submit@debbugs.gnu.org; Sun, 23 Feb 2025 16:54:33 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:20719) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tmJvi-0000x7-If for 76470@debbugs.gnu.org; Sun, 23 Feb 2025 16:54:32 -0500 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3FCD880AA7; Sun, 23 Feb 2025 16:54:23 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1740347662; bh=ToV5fU/wwRSyemERpKviMIXXPn0YZDy7yGsdfsmtsmU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=IfRk3b6ZnHgWKalfC0GquOKyPzEtvok2QnT2Nim4yxyebdgwLuFRL5fhxNJrDqz+P WBXthymHBNhqupTt1iCHrmDrKbb8OVJci7yjRUILFpxX0oXDNGN8a6VIxzuToN5l1g 94V+sPlVGYmw0BMRwUX02u5QycBajXg7WZ8oPaXR9y7qtmFKYJPwkE23nrCc9H1U+D BOmKRUaafLOJiIasDzCsSfQ7jmDLiHZAAcsSqDW/Ut3Vul9dBIj4Pb76+f19e1zfLH oheHkcPkrm6iK46caXuvlLDTeyn3ZatZJ11Dk6YhnLgcJLlOBp3aY6PwS8ToRnPnFZ biAth+xFJjtuw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3869A80823; Sun, 23 Feb 2025 16:54:22 -0500 (EST) Received: from pastel (unknown [104.247.242.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 14B3B1202A0; Sun, 23 Feb 2025 16:54:22 -0500 (EST) From: Stefan Monnier To: Stefan Kangas Subject: Re: bug#76470: 31.0.50; `setq-local` makes the var buffer-local too soon In-Reply-To: (Stefan Kangas's message of "Fri, 21 Feb 2025 17:01:48 +0000") Message-ID: References: Date: Sun, 23 Feb 2025 16:54:21 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.224 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76470 Cc: 76470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> As for how to implement that fix. The simplest way is to just change >> the macro, of course. But maybe a better way is to do it by introducing >> a `set-local` function (sibling to `set` and `set-default`) and then >> make the macro expand to a call to this function. > What are the benefits of adding a new function instead of just changing > the macro? - It adds the function (which is both a benefit and downside depending on how you look at it). - It makes the semantics more clear (this bug wouldn't have occurred if I had started with that). - It opens up the possibility to have a "real" `set-local` which doesn't introduce the spurious intermediate state where the var has already been made buffer-local but not yet set. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 23 18:17:31 2025 Received: (at 76470) by debbugs.gnu.org; 23 Feb 2025 23:17:31 +0000 Received: from localhost ([127.0.0.1]:37335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tmLE3-0007vY-Co for submit@debbugs.gnu.org; Sun, 23 Feb 2025 18:17:31 -0500 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]:51674) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tmLE0-0007vJ-Th for 76470@debbugs.gnu.org; Sun, 23 Feb 2025 18:17:29 -0500 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5dc89df7eccso6978958a12.3 for <76470@debbugs.gnu.org>; Sun, 23 Feb 2025 15:17:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740352643; x=1740957443; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=kQwyrRVSZg/Manz4rax/Gm6JIlS7pdGDWmdcUbYgTsE=; b=X2+q8QlTfuWwRp3pIBnBdIFjoOLF8f9/ugyuHRd05wbj0JhnUyHII8JX+E4GzQf3uY IToi3dOoEUB/10hxoel0b0R4+qNZjvOVjjiyNkbNOuDwyrbbSw2ySQuC07ylAJJOQ24k JYN/Y6dOAUIpD6IKuT5OIx8yw3O2UPIL2acQl3WdloJcskUmZu2olKZPkH78QPZCySlL HyO2cQeLPQOfJw+7U88ZUHZNxboE5tZ7KAaxNajLf8MVJ247HNbbVKOKzlVFddUCeCGY Bda8bHwmnjn1eF6+oiSXYLXtRyaOqsYfDadJAyLCOpgILyg/pEtXLd5fxaE61Ue4Xfo1 slGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740352643; x=1740957443; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kQwyrRVSZg/Manz4rax/Gm6JIlS7pdGDWmdcUbYgTsE=; b=tUNok54kgMTPbJOQystmqtPz32Ihnp6S11SYfB2+pgjsujItMmKaW+pc2y1MgIdJaH wpfli4UVfdGA+U/ne5nPGYwsooF0k2c75m5dBJjyVGtcuUn+xQpyl+htaeGbdZoXAMY4 2ecXK3nLdziAMmLgngUKBE+9sqpmTnmWuXAFzKul9TKJerBcffSbYmtpXEnba55pHTqS 7CuDjHtg+rtwWebLFBcK1FTHCHvVsfx1ps8BGUqsDMYm4oTzxVK4v7GtCKSu9hGzvqhO 8dRV1cJn/RKvuXE3zgldLl6TaqVRFy8wGla5UjrL4BOrYHmG21XjlYeL0b1g2W3yF1od dAZA== X-Gm-Message-State: AOJu0Ywp6yFAmPzEpFFXdgWT1u9fvoNrgGj8gKzybFZFCaTKepAQKPB5 qzmdBGBbVfYIDIaNwihSTQVsO940HbNajYghPcumWjcqiwnJerdi0B9AQi5z/lPF3eVF0PQOXZ2 KPVoGr38pSBkupg9hOJtshnNxgfc= X-Gm-Gg: ASbGnculPmCxUo+QJ/qTvHO8kLIkaYyvSNAN/3PuxrJRgwPZy0QLDKZZq2+jvijEcux iCPqOIhmplIOY5RhFkJqH2N+iPqA6gIrqshd5UCm3KJeIsGfsIcT+vOhPhcFnl5itOHYs76xwVT qaahWGz+hI X-Google-Smtp-Source: AGHT+IFVQHWL9Fjt3td6qRDwPWtLQm2r3ORncSlr9Gyk363OFnkTnCMtHKMyOpZJBg1gkQz7kjIJMB/zlmucB+b7bYI= X-Received: by 2002:a05:6402:270d:b0:5e0:8c55:518 with SMTP id 4fb4d7f45d1cf-5e0b70d0aa3mr10734973a12.1.1740352642395; Sun, 23 Feb 2025 15:17:22 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 23 Feb 2025 23:17:22 +0000 From: Stefan Kangas In-Reply-To: References: MIME-Version: 1.0 Date: Sun, 23 Feb 2025 23:17:22 +0000 X-Gm-Features: AWEUYZlFcztGyjZPZtBMoCwUkkSPWZnvakbe-roNLTDCns1LI_4GS-391mHyVw4 Message-ID: Subject: Re: bug#76470: 31.0.50; `setq-local` makes the var buffer-local too soon To: Stefan Monnier Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76470 Cc: 76470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >>> As for how to implement that fix. The simplest way is to just change >>> the macro, of course. But maybe a better way is to do it by introducing >>> a `set-local` function (sibling to `set` and `set-default`) and then >>> make the macro expand to a call to this function. >> What are the benefits of adding a new function instead of just changing >> the macro? > > - It adds the function (which is both a benefit and downside > depending on how you look at it). > - It makes the semantics more clear (this bug wouldn't have occurred if > I had started with that). > - It opens up the possibility to have a "real" `set-local` which doesn't > introduce the spurious intermediate state where the var has already > been made buffer-local but not yet set. OK, sounds good to me. Thanks.