From 7b9af7a02a1dd1401e9a5bdab831a640581a76c7 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 5 Jan 1996 02:42:32 +0000 Subject: [PATCH] (replace_buffer_in_all_windows): Only re-select old window if it is still live. --- src/window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.c b/src/window.c index c665a0c7c66..099730f05c5 100644 --- a/src/window.c +++ b/src/window.c @@ -1649,7 +1649,8 @@ replace_buffer_in_all_windows (buffer) window_loop (UNSHOW_BUFFER, buffer, 0, frame); } - Fselect_window (old_selected); + if (!NILP (Fwindow_live_p (old_selected))) + Fselect_window (old_selected); #else window_loop (UNSHOW_BUFFER, buffer, 0, Qt); #endif -- 2.39.2