GNU bug report logs - #75949
kill-buffer-quit-windows breaks kill-buffer-hook

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 30 Jan 2025 17:14:02 UTC

Severity: normal

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: 75949 <at> debbugs.gnu.org
Subject: bug#75949: kill-buffer-quit-windows breaks kill-buffer-hook
Date: Mon, 3 Feb 2025 09:33:45 +0100
>> Whatever it is, nesting 'kill-buffer-hook' as in
>>
>>   (add-hook 'kill-buffer-hook (lambda () (kill-buffer (get-buffer "bar")))
>> 	    nil t)
>>
>> is not really recommended.
>
> What is a recommended way to do this?  This is a valid use case
> when killing one buffer requires also killing a dependent buffer.

Any function on any hook that changes the corresponding infrastructure
should preserve the state around any such change.  The basic values that
should remain unchanged are the selected window, the selected window of
each frame and the current buffer (unless the function deletes them).

martin




This bug report was last modified 111 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.