Subject: bug#79280: package installation leaks tar-mode data buffers

From: Mattias Engdegård <[email-masked]>
Date: Thu, 21 Aug 2025 13:52:20 +0200

20 aug. 2025 kl. 23.06 skrev Stefan Monnier <[email-masked]>:

> Maybe we should be more careful when we skip `kill-buffer-hook`.
> Maybe we should run the local part of the hook (and skip the global part)?

Yes, I considered that but was worried about not having a hard way to kill a buffer without misguided kill-buffer-hook functions getting in the way. We'd be adding an override to the override, then an override to the override to the override, and so on.

A more principled solution might be to make buffers GC-able like any other object, at least optionally. Exactly how to do this can be discussed but maybe just being able to remove a buffer from Vbuffer_alist would do. (We have one buffer like that, Vprin1_to_string.) Of course, we'd have to teach the GC to destroy buffers. Fkill_buffer is depressingly long and complicated and should be broken up in smaller parts.

For now I'll just push the patch as a stopgap measure, but am definitely open to better solutions.