From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#46414: 27.1; remove-hook doesn't remove entries from hook--depth-alist Date: Thu, 16 Jun 2022 15:40:56 +0200 Message-ID: <87y1xwbuaf.fsf@gnus.org> References: <878s7w94o1.fsf@miha-pc> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2620"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 46414@debbugs.gnu.org To: jakanakaevangeli Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 16 16:08:16 2022 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 1o1qAS-0000S8-20 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Jun 2022 16:08:16 +0200 Original-Received: from localhost ([::1]:43722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1qAQ-0000F9-Td for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Jun 2022 10:08:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1pl4-0006pX-JR for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2022 09:42:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47216) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1pl4-0005QX-AV for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2022 09:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o1pl4-0007E0-8J for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2022 09:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jun 2022 13:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46414 X-GNU-PR-Package: emacs Original-Received: via spool by 46414-submit@debbugs.gnu.org id=B46414.165538687027701 (code B ref 46414); Thu, 16 Jun 2022 13:42:02 +0000 Original-Received: (at 46414) by debbugs.gnu.org; 16 Jun 2022 13:41:10 +0000 Original-Received: from localhost ([127.0.0.1]:41110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1pkE-0007Ci-7Q for submit@debbugs.gnu.org; Thu, 16 Jun 2022 09:41:10 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:44962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1pk9-0007Bc-Dg for 46414@debbugs.gnu.org; Thu, 16 Jun 2022 09:41:09 -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=Hh7xn1dKrApZ47FSrSCSuKpOmo/2+JEMAB6/awrQ7Jg=; b=Q4XFvLRdhaegMW6awgTuead+Hf aTLKDLiEhQMpdzhdcZyZBbXbPfgTiHYjUV8rG9hq1+v8BdmUOCMWaf1T4hwLS3Qwq8tSZu8cg+juK tcdseudsQMCEn8d5540+P2kuADnw8MtKF91W4FAXuR8BxpNPuG0n4p7kHA5d74DLk/yI=; Original-Received: from [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 1o1pk0-0008BE-IK; Thu, 16 Jun 2022 15:40:59 +0200 X-Now-Playing: AR Kane's _Single Collection (1)_: "Baby Milk Snatcher" In-Reply-To: <878s7w94o1.fsf@miha-pc> (jakanakaevangeli@chiru.no's message of "Wed, 10 Feb 2021 00:56:14 +0100") 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" Xref: news.gmane.io gmane.emacs.bugs:234640 Archived-At: jakanakaevangeli writes: > add-hook can add an entry to the hook symbol's hook--depth-alist > property and remove-hook doesn't remove it. This means that for each > call to eval-after-load, after-load-functions' hook--depth-alist gets a > new element when the feature is loaded, which can hinder performance. > > This can also cause problems if your completing-read-function uses > > (minibuffer-with-setup-hook (:append generated-function-symbol) > (read-from-minibuffer ...)) > > This will add a new element to minibuffer-setup-hook's the depth alist > for each completing-read session (such is the case when using > selectrum.el [1] completion function). (I'm going through old bug reports that unfortunately weren't resolved at the time.) The test case here isn't complete, so I can't test whether the problem is still present. I think it might have been fixed by: commit 4bd7963e2e244ace94afa59124f2637543d74ba2 Author: Stefan Monnier AuthorDate: Tue Feb 22 10:18:43 2022 -0500 (add-hook, remove-hook): Fix leaks (bug#48666) * lisp/subr.el (add-hook, remove-hook): Rewrite the hook depth management so we only keep the info relevant to functions present on the hook. Do you still see this problem in Emacs 29? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no