diff options
author | Martin Rudalics <rudalics@gmx.at> | 2022-02-21 16:46:23 +0100 |
---|---|---|
committer | Martin Rudalics <rudalics@gmx.at> | 2022-02-21 16:46:23 +0100 |
commit | 68d134cf0f784601e50cefc4056eb0ace510a982 (patch) | |
tree | 4c94f420b289e901bb21f8a7feab3d3972fcbe7d | |
parent | b38223a844caef920c2cd2c6e56e84b0c91df1fa (diff) | |
download | emacs-68d134cf0f784601e50cefc4056eb0ace510a982.tar.gz |
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).
-rw-r--r-- | lisp/window.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/window.el b/lisp/window.el index d9f36b9801f..a47a1216d10 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -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)))) |