]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't check whether a deleted window is deletable (Bug#54028)
authorMartin Rudalics <rudalics@gmx.at>
Mon, 21 Feb 2022 15:46:23 +0000 (16:46 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Mon, 21 Feb 2022 15:46:23 +0000 (16:46 +0100)
* lisp/window.el (window-state-put): Make sure window is live
before calling 'window-deletable-p' on it (Bug#54028).

lisp/window.el

index d9f36b9801f5dfe3a0262ff5a3725007b9150109..a47a1216d10216ef89355cc59a2ffe18dac21a9c 100644 (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))))