From unknown Mon Aug 18 11:26:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46407: 27.1; Hooks with permanent-local-hook are not cleared of lambdas Resent-From: jakanakaevangeli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Feb 2021 20:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 46407@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161290081522568 (code B ref -1); Tue, 09 Feb 2021 20:01:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Feb 2021 20:00:15 +0000 Received: from localhost ([127.0.0.1]:54713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9ZBD-0005rr-SS for submit@debbugs.gnu.org; Tue, 09 Feb 2021 15:00:15 -0500 Received: from lists.gnu.org ([209.51.188.17]:35162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9Ye8-0002wo-IB for submit@debbugs.gnu.org; Tue, 09 Feb 2021 14:26:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9Ye8-0005aY-Ag for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 14:26:00 -0500 Received: from chiru.no ([142.4.209.132]:58904) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1l9Ye6-0008Mc-LB for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 14:26:00 -0500 Received: from localhost (BSN-77-156-43.static.siol.net [193.77.156.43]) by chiru.no (Postfix) with ESMTPSA id 733D4128001C for ; Tue, 9 Feb 2021 19:25:56 +0000 (UTC) From: jakanakaevangeli Date: Tue, 09 Feb 2021 20:29:48 +0100 Message-ID: <87im7182fn.fsf@miha-pc> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: none client-ip=142.4.209.132; envelope-from=jakanakaevangeli@chiru.no; helo=chiru.no X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Mailman-Approved-At: Tue, 09 Feb 2021 15:00:10 -0500 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 (---) When kill-all-local-variables encounters a hook variable with its 'permanent-local property set to 'permanent-local-hook, it removes from its value every element except for t, functions with 'permanent-local-hook property and anything that isn't a symbol (see the comment at src/buffer.c:1072). This means that, for the following code (defvar 'some-hook nil) (add-hook 'some-hook #'some-fun nil t) (add-hook 'some-hook (lambda () (test)) nil t) whether some-fun is removed depends on some-fun's permanent-local-hook property, which is expected. As for the anonymous lambda function, it is not predictable, whether it will be kept or removed. In fact, it depends on some-fun's permanent-local-hook property. Perhaps it would make things more predictable to also remove non-symbol functions such as lambda expressions. See also info node (elisp) Creating Buffer-Local: > -- Function: kill-all-local-variables > This function eliminates all the buffer-local variable bindings > except for [...] and local hook functions that have a non-=E2=80=98n= il=E2=80=99 > =E2=80=98permanent-local-hook=E2=80=99 property. Which suggests that functions with a permanent-local-hook property should be the only exception. From unknown Mon Aug 18 11:26:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46407: 27.1; Hooks with permanent-local-hook are not cleared of lambdas Resent-From: jakanakaevangeli Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Feb 2021 21:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 46407@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16129065047277 (code B ref -1); Tue, 09 Feb 2021 21:36:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Feb 2021 21:35:04 +0000 Received: from localhost ([127.0.0.1]:54911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9af1-0001tJ-Su for submit@debbugs.gnu.org; Tue, 09 Feb 2021 16:35:04 -0500 Received: from lists.gnu.org ([209.51.188.17]:57008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9af0-0001sz-DA for submit@debbugs.gnu.org; Tue, 09 Feb 2021 16:35:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9af0-00015Y-5l for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 16:35:02 -0500 Received: from chiru.no ([142.4.209.132]:43090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1l9aex-0004Bm-5v for bug-gnu-emacs@gnu.org; Tue, 09 Feb 2021 16:35:01 -0500 Received: from localhost (BSN-77-156-43.static.siol.net [193.77.156.43]) by chiru.no (Postfix) with ESMTPSA id 6A715128001C for ; Tue, 9 Feb 2021 21:34:57 +0000 (UTC) From: jakanakaevangeli In-Reply-To: <87im7182fn.fsf@miha-pc> References: <87im7182fn.fsf@miha-pc> Date: Tue, 09 Feb 2021 22:38:49 +0100 Message-ID: <87ft249b12.fsf@miha-pc> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: none client-ip=142.4.209.132; envelope-from=jakanakaevangeli@chiru.no; helo=chiru.no X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) 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 (---) Also one more thing: (defvar some-hook nil) (add-hook 'some-hook #'some-fun nil t) (put 'some-fun 'permanent-local-hook t) If we mark a function as permanent-local-hook only after adding it to a hook, the hook symbol will not have its permanent-local property set to 'permanent-local-hook, so some-fun will not be kept on removal of local variables. This can be a real non-theoretical problem when adding an autoloaded function to a hook. From unknown Mon Aug 18 11:26:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46407: 27.1; Hooks with permanent-local-hook are not cleared of lambdas Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 May 2021 12:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 46407@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16216014702982 (code B ref -1); Fri, 21 May 2021 12:52:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 May 2021 12:51:10 +0000 Received: from localhost ([127.0.0.1]:36022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lk4cQ-0000m2-2H for submit@debbugs.gnu.org; Fri, 21 May 2021 08:51:10 -0400 Received: from lists.gnu.org ([209.51.188.17]:48516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lk4cL-0000lr-4I for submit@debbugs.gnu.org; Fri, 21 May 2021 08:51:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lk4cK-0002NM-PI for bug-gnu-emacs@gnu.org; Fri, 21 May 2021 08:51:04 -0400 Received: from chiru.no ([142.4.209.132]:43766) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1lk4cH-0007eB-O4 for bug-gnu-emacs@gnu.org; Fri, 21 May 2021 08:51:04 -0400 Received: from localhost (BSN-77-156-43.static.siol.net [193.77.156.43]) by chiru.no (Postfix) with ESMTPSA id E8037128001C for ; Fri, 21 May 2021 12:50:57 +0000 (UTC) From: In-Reply-To: <87ft249b12.fsf@miha-pc> References: <87im7182fn.fsf@miha-pc> <87ft249b12.fsf@miha-pc> Date: Fri, 21 May 2021 14:56:17 +0200 Message-ID: <87a6oo455a.fsf@miha-pc> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: none client-ip=142.4.209.132; envelope-from=jakanakaevangeli@chiru.no; helo=chiru.no X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, BODY_SINGLE_WORD=0.001, FSL_BULK_SIG=0.001, PYZOR_CHECK=1.392, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) 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 (---) Ping. From unknown Mon Aug 18 11:26:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46407: 27.1; Hooks with permanent-local-hook are not cleared of lambdas Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 May 2021 21:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: jakanakaevangeli Cc: 46407@debbugs.gnu.org Received: via spool by 46407-submit@debbugs.gnu.org id=B46407.162189334314506 (code B ref 46407); Mon, 24 May 2021 21:56:02 +0000 Received: (at 46407) by debbugs.gnu.org; 24 May 2021 21:55:43 +0000 Received: from localhost ([127.0.0.1]:44078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llIY2-0003lu-Sp for submit@debbugs.gnu.org; Mon, 24 May 2021 17:55:43 -0400 Received: from quimby.gnus.org ([95.216.78.240]:36704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llIXx-0003lc-99 for 46407@debbugs.gnu.org; Mon, 24 May 2021 17:55:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=zG0RINSYxJcbDAjGJ8NYtfRLKgzkjj/SpM1hRKi4HTc=; b=ON6AdgM3oD2oRheLNIYUuULULx DBQ3x8OsMYXeXKtxQmZp0WoKidMDKXUrYIfN6x5sRkcsI6v3evwMDZaKQYeNnq0wFHaiZ5PiWquWM xBQGCS1/II+CcVAqRXSHyH1f3e8hRBRCjJxlJYwRu78vT7alL9ZG+MEssAi2lqJ3Q1SY=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llIXo-0006Z9-Hf; Mon, 24 May 2021 23:55:30 +0200 From: Lars Ingebrigtsen References: <87im7182fn.fsf@miha-pc> X-Now-Playing: 'O'rang's _Herd of Instinct_: "Nahoojek-Fogou" Date: Mon, 24 May 2021 23:55:28 +0200 In-Reply-To: <87im7182fn.fsf@miha-pc> (jakanakaevangeli@chiru.no's message of "Tue, 09 Feb 2021 20:29:48 +0100") Message-ID: <87eedvajan.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: jakanakaevangeli writes: > When kill-all-local-variables encounters a hook variable with its > 'permanent-local property set to 'permanent-local-hook, it removes from > its value every element except for t, functions with > ' [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) 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 (-) jakanakaevangeli writes: > When kill-all-local-variables encounters a hook variable with its > 'permanent-local property set to 'permanent-local-hook, it removes from > its value every element except for t, functions with > 'permanent-local-hook property and anything that isn't a symbol > (see the comment at src/buffer.c:1072). > > This means that, for the following code > > (defvar 'some-hook nil) > (add-hook 'some-hook #'some-fun nil t) > (add-hook 'some-hook (lambda () (test)) nil t) > > whether some-fun is removed depends on some-fun's permanent-local-hook > property, which is expected. As for the anonymous lambda function, it is > not predictable, whether it will be kept or removed. In fact, it depends > on some-fun's permanent-local-hook property. Well, it depends on the hook's permanent-local-hook property, but it's true that add-hook will automatically set that for you if you pass in a symbol with that property set. So, yes, that's a strange side effect of this interface, but I'm not sure anything could be done about it at this stage (it was introduced in this form almost two decades ago). jakanakaevangeli writes: > Also one more thing: > > (defvar some-hook nil) > (add-hook 'some-hook #'some-fun nil t) > (put 'some-fun 'permanent-local-hook t) > > If we mark a function as permanent-local-hook only after adding it to a > hook, the hook symbol will not have its permanent-local property set to > 'permanent-local-hook, so some-fun will not be kept on removal of local > variables. > > This can be a real non-theoretical problem when adding an autoloaded > function to a hook. You mean if the property isn't part of the autoloaded signature? Yes, that's true. As far as I can tell, this permanent-local-hook stuff isn't used anywhere in the Emacs tree, and it seems like a pretty odd and (as this bug report shows) inconsistent interface. I'm not sure whether it's worth trying to fix, or we should just document that it's iffy. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Mon Aug 18 11:26:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46407: 27.1; Hooks with permanent-local-hook are not cleared of lambdas Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 May 2021 07:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lars Ingebrigtsen Cc: 46407@debbugs.gnu.org Received: via spool by 46407-submit@debbugs.gnu.org id=B46407.16219263262286 (code B ref 46407); Tue, 25 May 2021 07:06:02 +0000 Received: (at 46407) by debbugs.gnu.org; 25 May 2021 07:05:26 +0000 Received: from localhost ([127.0.0.1]:44539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llR82-0000ao-EA for submit@debbugs.gnu.org; Tue, 25 May 2021 03:05:26 -0400 Received: from chiru.no ([142.4.209.132]:45358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llR7z-0000ae-2a for 46407@debbugs.gnu.org; Tue, 25 May 2021 03:05:24 -0400 Received: from localhost (BSN-77-156-43.static.siol.net [193.77.156.43]) by chiru.no (Postfix) with ESMTPSA id 8541E128001B; Tue, 25 May 2021 07:05:20 +0000 (UTC) From: In-Reply-To: <87eedvajan.fsf@gnus.org> References: <87im7182fn.fsf@miha-pc> <87eedvajan.fsf@gnus.org> Date: Tue, 25 May 2021 09:10:43 +0200 Message-ID: <87r1hv2sr0.fsf@miha-pc> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) 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 (-) Lars Ingebrigtsen writes: > jakanakaevangeli writes: > >> When kill-all-local-variables encounters a hook variable with its >> 'permanent-local property set to 'permanent-local-hook, it removes from >> its value every element except for t, functions with >> 'permanent-local-hook property and anything that isn't a symbol >> (see the comment at src/buffer.c:1072). >> >> This means that, for the following code >> >> (defvar 'some-hook nil) >> (add-hook 'some-hook #'some-fun nil t) >> (add-hook 'some-hook (lambda () (test)) nil t) >> >> whether some-fun is removed depends on some-fun's permanent-local-hook >> property, which is expected. As for the anonymous lambda function, it is >> not predictable, whether it will be kept or removed. In fact, it depends >> on some-fun's permanent-local-hook property. > > Well, it depends on the hook's permanent-local-hook property, but it's > true that add-hook will automatically set that for you if you pass in a > symbol with that property set. > So, yes, that's a strange side effect of this interface, but I'm not > sure anything could be done about it at this stage (it was introduced in > this form almost two decades ago). On the other hand, this side effect is so undocumented and undiscoverable (and most probably not really of any use as well), that I highly doubt there is even a single instance of anyone relying in it deliberately. I may be wrong though. > > jakanakaevangeli writes: > >> Also one more thing: >> >> (defvar some-hook nil) >> (add-hook 'some-hook #'some-fun nil t) >> (put 'some-fun 'permanent-local-hook t) >> >> If we mark a function as permanent-local-hook only after adding it to a >> hook, the hook symbol will not have its permanent-local property set to >> 'permanent-local-hook, so some-fun will not be kept on removal of local >> variables. >> >> This can be a real non-theoretical problem when adding an autoloaded >> function to a hook. > > You mean if the property isn't part of the autoloaded signature? Yes, > that's true. Whoops, I forgot that one can simply put an autoload cookie on the (put ...) form as well. Please ignore my second post. > As far as I can tell, this permanent-local-hook stuff isn't used > anywhere in the Emacs tree, and it seems like a pretty odd and (as this > bug report shows) inconsistent interface. I'm not sure whether it's > worth trying to fix, or we should just document that it's iffy. I'm personally in favour of fixing the `kill-all-local-variables' inconsistency (patch follows). If not, then yes, we should document it in add-hook and fix the info node I mentioned. Though that would leave virtually every local addition of a lambda to a hook invalid and a possible bug (a quick grep reveals that there are at least three such usages in Emacs itself). diff --git a/src/buffer.c b/src/buffer.c index 565577e75a..6933f89bd4 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1079,9 +1079,9 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too) /* Preserve element ELT if it's t, if it is a function with a `permanent-local-hook' property, or if it's not a symbol. */ - if (! SYMBOLP (elt) - || EQ (elt, Qt) - || !NILP (Fget (elt, Qpermanent_local_hook))) + if (EQ (elt, Qt) + || (SYMBOLP (elt) + && !NILP (Fget (elt, Qpermanent_local_hook)))) newlist = Fcons (elt, newlist); } newlist = Fnreverse (newlist); > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no Best regards. From unknown Mon Aug 18 11:26:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46407: 27.1; Hooks with permanent-local-hook are not cleared of lambdas Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 May 2021 19:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Cc: 46407@debbugs.gnu.org Received: via spool by 46407-submit@debbugs.gnu.org id=B46407.16219698163876 (code B ref 46407); Tue, 25 May 2021 19:11:01 +0000 Received: (at 46407) by debbugs.gnu.org; 25 May 2021 19:10:16 +0000 Received: from localhost ([127.0.0.1]:46787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llcRT-00010Q-LM for submit@debbugs.gnu.org; Tue, 25 May 2021 15:10:15 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llcRS-000108-2b for 46407@debbugs.gnu.org; Tue, 25 May 2021 15:10:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vU53vgvXIYUbD/co1UjVRAxluTcAe355b5e0qvkVGQo=; b=FwQoPhK0Qm51VPh+CxQC8gFfZG 225y66cwKhwVkVe7zQ1riIhiKpudfAA17SQ5tBYgd834Wbnb833KgphX0lnxoYjMmlnNpk/xfcc31 pcoEsECd8d/q59o6lzTb4uAPSIWWBqP+YDohhfb4+QHlrmGsy74FjBePanYy44Xir6mM=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llcRI-00042w-QM; Tue, 25 May 2021 21:10:07 +0200 From: Lars Ingebrigtsen References: <87im7182fn.fsf@miha-pc> <87eedvajan.fsf@gnus.org> <87r1hv2sr0.fsf@miha-pc> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEWhloxiWlaLf3c3 MTDaybT///+9ycUnAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+UFGRMDE95fuMAAAAGpSURBVDjLbZTb leQgDEQFZwNwoQSEnMBiNv/YthDGdnebjzkeLnqXWmQdIMMkj0/twHWfei/YMrY3UC3xxl0b+gVc +2ZSASPoN8ionV5ycbesvekNiha3Cs/uvfcrRmpFDwJljErQFtBWpwW8KkHEMBE+omO3VJ6AEeK7 FxeUkdQJ6CHuW8lei+MEFjUEMHEpFberSEP7YaNT0E9AF+7DPKNfgLFZwwhGE3sAlmdO3ofRNFkF Mh+TnZ1ggY7bIqrMew/CtPAAcvaIpMD0ASyS4xhLxHlYzIYhwMcZDYsQr6B2JvgNio7Qm5h9gjpz +rpdoOLnfigLjhfA4IXJ/gLZG6dXpnw/LY6M0O73UVq8JCU5tfoWgtsB6DYGI1QLu0qxUoBAlHcd ib9DF9pYR7+O6PXJbcFJhsV81sZ/7lnOKXIm52tdK0F5WR45Lzc/zRiBG2ZCRVZOdZvyisxq4mIC x0b5IE3h0YBLlsT+AH//yR5gekPd+Y61H8O61TRHpDM8fwC8hOLWvEIgzk3goq2WrA5GBjokN2s/ ZWs52nh3p0moKzpcFgg5/gfvWFgFvoa84AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0wNS0yNVQx OTowMzoxOSswMDowMCPE14kAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDUtMjVUMTk6MDM6MTkr MDA6MDBSmW81AAAAAElFTkSuQmCC X-Now-Playing: Ultra Milkmaids's _Mort Aux Vaches_: "Vor-juble 2" Date: Tue, 25 May 2021 21:10:04 +0200 In-Reply-To: <87r1hv2sr0.fsf@miha-pc> (jakanakaevangeli@chiru.no's message of "Tue, 25 May 2021 09:10:43 +0200") Message-ID: <87o8cypr3n.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: writes: > On the other hand, this side effect is so undocumented and > undiscoverable (and most probably not really of any use as well), that I > highly doubt there is even a single instance of anyone relying [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) 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 (-) writes: > On the other hand, this side effect is so undocumented and > undiscoverable (and most probably not really of any use as well), that I > highly doubt there is even a single instance of anyone relying in it > deliberately. I may be wrong though. Yeah, that's the problem -- it's hard to say whether anybody relies on this weird behaviour. There are no in-tree usages of permanent-local-hook at all as far as I can see, so I wondered whether is was used at all: https://github.com/search?q=permanent-local-hook+extension%3A.el&type=Code&ref=advsearch&l=&l= And the answer is yes. (But that doesn't tell us if anybody relies on the non-symbol behaviour, though.) > I'm personally in favour of fixing the `kill-all-local-variables' > inconsistency (patch follows). > > If not, then yes, we should document it in add-hook and fix the info > node I mentioned. Though that would leave virtually every local addition > of a lambda to a hook invalid and a possible bug (a quick grep reveals > that there are at least three such usages in Emacs itself). I'm leaning towards applying your patch (i.e., changing the behaviour as you suggest), because it's somewhat difficult to imagine anybody relying on the current, odd behaviour. Does anybody object? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue May 25 15:10:24 2021 Received: (at control) by debbugs.gnu.org; 25 May 2021 19:10:24 +0000 Received: from localhost ([127.0.0.1]:46790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llcRb-00010p-VK for submit@debbugs.gnu.org; Tue, 25 May 2021 15:10:24 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1llcRa-00010c-CI for control@debbugs.gnu.org; Tue, 25 May 2021 15:10:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NJYA9uFGeX+Yvh3Tn+IFwpqKF+UT3ZQIH0h0lXwpkW4=; b=fCH/51WfWVgo/7bKFSZhX/GM4g fTPxfSaQgirDK653P127BXUkHFbZlcF4vSTbxchLuJiB5uS1xURJPqjCDnEMVo3WtYquiJarTWON3 ceg3g1eYoIM3Ab6JzV7Ry1uXZ9k1SA9FW3eYwhD6QCY5VeHudo89kepQ18Y7nQ126OQg=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1llcRS-000438-V7 for control@debbugs.gnu.org; Tue, 25 May 2021 21:10:16 +0200 Date: Tue, 25 May 2021 21:10:14 +0200 Message-Id: <87mtsipr3d.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #46407 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 46407 + patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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 (-) tags 46407 + patch quit From unknown Mon Aug 18 11:26:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46407: 27.1; Hooks with permanent-local-hook are not cleared of lambdas Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Jul 2021 14:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46407 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Cc: 46407@debbugs.gnu.org Received: via spool by 46407-submit@debbugs.gnu.org id=B46407.162679153018946 (code B ref 46407); Tue, 20 Jul 2021 14:33:02 +0000 Received: (at 46407) by debbugs.gnu.org; 20 Jul 2021 14:32:10 +0000 Received: from localhost ([127.0.0.1]:35024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5qn4-0004vK-0y for submit@debbugs.gnu.org; Tue, 20 Jul 2021 10:32:10 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5qn2-0004pm-D7 for 46407@debbugs.gnu.org; Tue, 20 Jul 2021 10:32:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=bPrGy3u6IKNOS6jrjtdsxkC5q6hMeQVYL684kCxfXD0=; b=EwgnyLQY7CixrIGTvIprWPKXtS sHfBryZ1juLMeRHdUW2y281YKdBDLokDJ8CC0VfpBPdywLnuQBJQS9ND1AK2/oXC464/VKbLG5bOq a6gYWqcka0OmZCJ/lG5l+yDBYfr9Oef5fCvTqdE6Kq/Cs8pFF1rfWodj+7zHLchUt2D4=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5qms-00049y-BG; Tue, 20 Jul 2021 16:32:00 +0200 From: Lars Ingebrigtsen References: <87im7182fn.fsf@miha-pc> <87eedvajan.fsf@gnus.org> <87r1hv2sr0.fsf@miha-pc> <87o8cypr3n.fsf@gnus.org> X-Now-Playing: Late Night Approach's _Fabric 94: Steffi_: "Poison Valley" Date: Tue, 20 Jul 2021 16:31:57 +0200 In-Reply-To: <87o8cypr3n.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 25 May 2021 21:10:04 +0200") Message-ID: <87r1ftcazm.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > I'm leaning towards applying your patch (i.e., changing the behaviour as > you suggest), because it's somewhat difficult to imagine anybody relying > on the current, odd behaviour. > > Does anybody [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) 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 (---) Lars Ingebrigtsen writes: > I'm leaning towards applying your patch (i.e., changing the behaviour as > you suggest), because it's somewhat difficult to imagine anybody relying > on the current, odd behaviour. > > Does anybody object? There were no objections, so I've now applied your patch. This change was small enough to apply without assigning copyright to the FSF, but for future patches you want to submit, it might make sense to get the paperwork started now, so that subsequent patches can be applied speedily. Would you be willing to sign such paperwork? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 20 10:32:13 2021 Received: (at control) by debbugs.gnu.org; 20 Jul 2021 14:32:13 +0000 Received: from localhost ([127.0.0.1]:35027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5qn7-0004yB-Cx for submit@debbugs.gnu.org; Tue, 20 Jul 2021 10:32:13 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5qn6-0004tO-Qq for control@debbugs.gnu.org; Tue, 20 Jul 2021 10:32:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JO0J3kvU11JZEkqjAs1RWGusVKVYIeop9k7L47QL2DE=; b=k6QGEw5JFoPd0qY41dwTxQVTcd Afh7+7OoBAVnbsSOkWvzThKerSG1V4Y+wlgX54AE1XfZLVbM+327UNPcWCwuedrIiTSAuTQQf6tSO uQZIS77gYzKELA5cnVTCsYQ6c55t+u8keF1WsiPpnDAjG6Xzr4p83pMgKevSvRGQMrT0=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5qmz-0004AB-8U for control@debbugs.gnu.org; Tue, 20 Jul 2021 16:32:07 +0200 Date: Tue, 20 Jul 2021 16:32:04 +0200 Message-Id: <87pmvdcazf.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #46407 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 46407 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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 (---) close 46407 28.1 quit