From 9ace597fcf31409f04cbf01c5e299c2c4c8a3ff1 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Mon, 28 Sep 1992 06:10:03 +0000 Subject: [PATCH] * window.c (delete_all_subwindows): Save the window's buffer in its `height' field; we may need to know the window's old buffer once we have restored it from a window configuration. Fset_window_configuration): When we restore a window, if its `height' field is a buffer, restore its `buffer' field from that. This allows us to leave the window's buffer unchanged if the buffer recorded in the configuration is dead. * window.c (delete_all_subwindows): Removed unused variable named "count". --- src/window.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/window.c b/src/window.c index 2ae981aa07b..f11fed9a2df 100644 --- a/src/window.c +++ b/src/window.c @@ -2386,8 +2386,13 @@ by `current-window-configuration' (which see).") if (NILP (XBUFFER (new_current_buffer)->name)) new_current_buffer = Qnil; - /* Mark all windows now on frame as "deleted". - Restoring the new configuration "undeletes" any that are in it. */ + /* Kludge Alert! + Mark all windows now on frame as "deleted". + Restoring the new configuration "undeletes" any that are in it. + + Save their current buffers in their height fields, since we may + need it later, if the buffer saved in the configuration is now + dead. */ delete_all_subwindows (XWINDOW (FRAME_ROOT_WINDOW (f))); for (k = 0; k < saved_windows->size; k++) @@ -2423,6 +2428,11 @@ by `current-window-configuration' (which see).") } } } + + /* If we squirreled away the buffer in the window's height, + restore it now. */ + if (XTYPE (w->height) == Lisp_Buffer) + w->buffer = w->height; w->left = p->left; w->top = p->top; w->width = p->width; @@ -2506,7 +2516,7 @@ static void delete_all_subwindows (w) register struct window *w; { - register int count = 1; + w->height = w->buffer; /* See Fset_window_configuration for excuse. */ w->buffer = Qnil; if (!NILP (w->next)) delete_all_subwindows (XWINDOW (w->next));