changeset 1237:3929b2135e58

* 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".
author Jim Blandy <jimb@redhat.com>
date Mon, 28 Sep 1992 06:10:03 +0000
parents 5e8c234e5f03
children 407100cee78a
files src/window.c
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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));