all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: jakanakaevangeli@chiru.no
Cc: 48666@debbugs.gnu.org, Daniel Mendler <mail@daniel-mendler.de>
Subject: bug#48666: Leaks are still possible in hook--depth-alist
Date: Tue, 22 Feb 2022 10:25:35 -0500	[thread overview]
Message-ID: <jwvwnhngc9d.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <877djlrhx0.fsf@miha-pc> (jakanakaevangeli@chiru.no's message of "Wed, 26 May 2021 10:57:47 +0200")

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>
'hook--depth-alist) away but you need to (symbol-value (get <hook>
'hook--depth-alist)) and that will only show you the global portion or
the portion relevant to the current buffer.


        Stefan






  reply	other threads:[~2022-02-22 15:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26  8:57 bug#48666: Leaks are still possible in hook--depth-alist jakanakaevangeli
2022-02-22 15:25 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-07-15 10:40   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvwnhngc9d.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=48666@debbugs.gnu.org \
    --cc=jakanakaevangeli@chiru.no \
    --cc=mail@daniel-mendler.de \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.