Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs

This commit is contained in:
Eli Zaretskii 2025-01-31 10:43:35 +02:00
commit c2822650a2

View file

@ -5224,7 +5224,12 @@ buffer by itself."
(cond
((window-minibuffer-p window))
(kill-buffer-quit-windows
(quit-restore-window window 'killing))
;; Try to preserve the current buffer set up by 'kill-buffer'
;; before running the hooks on 'kill-buffer-hook' (Bug#75949).
(let ((current-buffer (current-buffer)))
(quit-restore-window window 'killing)
(when (buffer-live-p current-buffer)
(set-buffer current-buffer))))
(t
(let ((dedicated-side (eq (window-dedicated-p window) 'side)))
(when (or dedicated-side (not (window--delete window t 'kill)))