Don't check whether a deleted window is deletable (Bug#54028)

* lisp/window.el (window-state-put): Make sure window is live
before calling 'window-deletable-p' on it (Bug#54028).
This commit is contained in:
Martin Rudalics 2022-02-21 16:46:23 +01:00
parent b38223a844
commit 68d134cf0f

View file

@ -6410,7 +6410,11 @@ windows can get as small as `window-safe-min-height' and
(window--state-put-2 ignore pixelwise))
(while window-state-put-stale-windows
(let ((window (pop window-state-put-stale-windows)))
(when (eq (window-deletable-p window) t)
;; Avoid that 'window-deletable-p' throws an error if window
;; was already deleted when exiting 'with-temp-buffer' above
;; (Bug#54028).
(when (and (window-valid-p window)
(eq (window-deletable-p window) t))
(delete-window window))))
(window--check frame))))