From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.bugs Subject: bug#46414: 27.1; remove-hook doesn't remove entries from hook--depth-alist Date: Thu, 16 Jun 2022 16:18:55 +0200 Message-ID: <877d5g4row.fsf@miha-pc> References: <878s7w94o1.fsf@miha-pc> <87y1xwbuaf.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7871"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46414-done@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 16 16:09: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 1o1qBQ-0001oL-G1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Jun 2022 16:09:16 +0200 Original-Received: from localhost ([::1]:44912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1qBO-00015H-NW for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Jun 2022 10:09:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1qBC-000149-ED for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2022 10:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48829) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1qBC-0003Ia-5u for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2022 10:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o1qBB-00020H-Vc for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2022 10:09:01 -0400 Resent-From: Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Jun 2022 14:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 46414 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Mail-Followup-To: 46414@debbugs.gnu.org, jakanakaevangeli@chiru.no, jakanakaevangeli@chiru.no Original-Received: via spool by 46414-done@debbugs.gnu.org id=D46414.16553884897634 (code D ref 46414); Thu, 16 Jun 2022 14:09:01 +0000 Original-Received: (at 46414-done) by debbugs.gnu.org; 16 Jun 2022 14:08:09 +0000 Original-Received: from localhost ([127.0.0.1]:42724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1qAL-0001z4-Ch for submit@debbugs.gnu.org; Thu, 16 Jun 2022 10:08:09 -0400 Original-Received: from kamnitnik.top ([209.250.245.214]:59746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1qAI-0001yu-N4 for 46414-done@debbugs.gnu.org; Thu, 16 Jun 2022 10:08:08 -0400 In-Reply-To: <87y1xwbuaf.fsf@gnus.org> 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:234641 Archived-At: Lars Ingebrigtsen writes: > 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 Yep it was fixed by this commit and also the related commit db92e83797bf2f1af4e0b0383283a49968746b51 Author: Stefan Monnier Date: Fri Apr 23 16:50:12 2021 -0400 * lisp/subr.el (add-hook): Try and fix bug#46326 Use `eq` indexing on `hook--depth-alist`. (remove-hook): Remove old entries from `hook--depth-alist`. Thanks.