summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2022-12-16 16:29:51 +0200
committerEli Zaretskii <eliz@gnu.org>2022-12-16 16:29:51 +0200
commit89f54e81576d9d9e35b67e7c5831495c4bb444c5 (patch)
treeb9782b823780065473c9b5660e6f8c3ea4554c17 /src/window.c
parent1b9ca1e5e646cdd678f0d29ef5e833c8ff2298c5 (diff)
downloademacs-89f54e81576d9d9e35b67e7c5831495c4bb444c5.tar.gz
A better fix for bug#60096
* lisp/startup.el (initial-scratch-message): * lisp/simple.el (get-scratch-buffer-create): Revert last changes. * src/window.c (Fset_window_configuration): Force recalculation of Vwindow_list after restoring the windows. * src/buffer.c (other_buffer_safely): Make sure we always return a valid buffer, even if 'get-scratch-buffer-create' signals an error.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/window.c b/src/window.c
index f116b9a9d72..90fa6ac2dfe 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2639,7 +2639,7 @@ window_list (void)
Lisp_Object arglist = Qnil;
/* We are visiting windows in canonical order, and add
- new windows at the front of args[1], which means we
+ new windows at the front of arglist, which means we
have to reverse this list at the end. */
foreach_window (XFRAME (frame), add_window_to_list, &arglist);
arglist = Fnreverse (arglist);
@@ -7329,6 +7329,14 @@ the return value is nil. Otherwise the value is t. */)
last_selected_window)
= selected_window;
+ /* We may have deleted windows above. Then again, maybe we
+ haven't: the functions we call to maybe delete windows can
+ decide a window cannot be deleted. Force recalculation of
+ Vwindow_list next time it is needed, to make sure stale
+ windows with no buffers don't escape into the wild, which
+ will cause crashes elsewhere. */
+ Vwindow_list = Qnil;
+
if (NILP (data->focus_frame)
|| (FRAMEP (data->focus_frame)
&& FRAME_LIVE_P (XFRAME (data->focus_frame))))