# HG changeset patch # User Jim Blandy # Date 717660603 0 # Node ID 3929b2135e58329a2fc3f46db961a6158ae959fd # Parent 5e8c234e5f03d67a934296e35074cadfeb99fcc9 * 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". diff -r 5e8c234e5f03 -r 3929b2135e58 src/window.c --- a/src/window.c Mon Sep 28 02:20:23 1992 +0000 +++ b/src/window.c Mon Sep 28 06:10:03 1992 +0000 @@ -2386,8 +2386,13 @@ 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 @@ } } } + + /* 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 @@ 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));