From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#48666: Leaks are still possible in hook--depth-alist Date: Tue, 22 Feb 2022 10:25:35 -0500 Message-ID: References: <877djlrhx0.fsf@miha-pc> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7148"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 48666@debbugs.gnu.org, Daniel Mendler To: jakanakaevangeli@chiru.no Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 22 17:21:17 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 1nMXue-0001ha-Fo for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Feb 2022 17:21:16 +0100 Original-Received: from localhost ([::1]:42560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMXud-0005vZ-1d for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Feb 2022 11:21:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMX3C-0004dL-7b for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2022 10:26:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nMX3B-0005KO-TZ for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2022 10:26:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nMX3B-0000Tq-RQ for bug-gnu-emacs@gnu.org; Tue, 22 Feb 2022 10:26:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Feb 2022 15:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48666 X-GNU-PR-Package: emacs Original-Received: via spool by 48666-submit@debbugs.gnu.org id=B48666.16455435501824 (code B ref 48666); Tue, 22 Feb 2022 15:26:01 +0000 Original-Received: (at 48666) by debbugs.gnu.org; 22 Feb 2022 15:25:50 +0000 Original-Received: from localhost ([127.0.0.1]:42383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMX30-0000TM-BU for submit@debbugs.gnu.org; Tue, 22 Feb 2022 10:25:50 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nMX2z-0000T6-1Z for 48666@debbugs.gnu.org; Tue, 22 Feb 2022 10:25:49 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id F1F9D441115; Tue, 22 Feb 2022 10:25:42 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7B34A4410ED; Tue, 22 Feb 2022 10:25:41 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1645543541; bh=ahQ+vHfZ7P6tAeGzUiFu74p3Nw1pABes4UX2a3GrRII=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=KyoIPPQVqerAOpFR8dxDzXLU2NuHsRnYrqeJJ6+IiUJ6cCyLGBMDyznZ4VMzDDLUG fIkA5+8y1fgFDnImQDDX8Ry9eOeK6uERCzGz8dyBa2ijUEnw2h+GUrEkY7jgQttnCQ tqS7JjBWM6U1kKj4CRNs/J9ThEwEAwtoWhPrUBZDZJniRy3LykJXGzuLb0rgJGC/2X U7Pj3tWk5xF5nBJbYBrxn6ZDs2f4PT0J5Go+sj4Cr1tXsmARRKE1JxKMygEkMZ7ooJ R30CGAT445fJ4dn6obbWGB05D7YmH2myUECzYmv8DkJPYKikpaW5LoFi92FeULz60a LVLXYdFEgiPmw== Original-Received: from pastel (unknown [45.72.197.68]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 49F1D12023D; Tue, 22 Feb 2022 10:25:41 -0500 (EST) In-Reply-To: <877djlrhx0.fsf@miha-pc> (jakanakaevangeli@chiru.no's message of "Wed, 26 May 2021 10:57:47 +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" Xref: news.gmane.io gmane.emacs.bugs:227444 Archived-At: jakanakaevangeli@chiru.no [2021-05-26 10:57:47] wrote: > (with-temp-buffer > (add-hook 'post-command-hook (make-symbol "fun-sym") 77 t)) > (get 'post-command-hook 'hook--depth-alist) > Perhaps hook--depth-alist could be a hash table with weak keys. I just pushed to `master` a patch which should hopefully fix this problem for good (basically, the depth alist is now kept in an(other) variable (so for functions added to the buffer-local portion of the hook, the depth is stored in the buffer-local portion of the depth variable)). I hope it will also fix the problems seen in https://github.com/minad/corfu/issues/133 It makes it a bit harder to check if the old problem is still present or not, OTOH, because the depth-alist isn't just a quick (get 'hook--depth-alist) away but you need to (symbol-value (get 'hook--depth-alist)) and that will only show you the global portion or the portion relevant to the current buffer. Stefan