From df3706a3c36e9cd3f7e77eff4fedde97677856db Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 4 Nov 2025 10:08:19 +0100 Subject: [PATCH] Fix thinko in 'delete-other-frames' * lisp/frame.el (delete-other-frames): In second round make sure the candidate frame has not been deleted in the first round to avoid that 'frame-terminal' and friends throw an error. --- lisp/frame.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/frame.el b/lisp/frame.el index 6e18ba65d9a..c48b2c4af1e 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -2889,7 +2889,10 @@ deleting them." (if iconify (iconify-frame this) (delete-frame this)))) ;; In a second round consider all remaining frames. (dolist (this frames) - (unless (or (eq this frame) + ;; We did not recalculate FRAMES so make sure THIS is still a live + ;; frame since otherwise 'frame-terminal' will throw an error. + (unless (or (not (frame-live-p this)) + (eq this frame) (eq this minibuffer-frame) (not (eq (frame-terminal this) terminal)) ;; When FRAME is a child frame, delete its siblings