Commit 9ace597f authored by Jim Blandy's avatar Jim Blandy
Browse files

* 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
parent fde3a52f
...@@ -2386,8 +2386,13 @@ by `current-window-configuration' (which see).") ...@@ -2386,8 +2386,13 @@ by `current-window-configuration' (which see).")
if (NILP (XBUFFER (new_current_buffer)->name)) if (NILP (XBUFFER (new_current_buffer)->name))
new_current_buffer = Qnil; new_current_buffer = Qnil;
/* Mark all windows now on frame as "deleted". /* Kludge Alert!
Restoring the new configuration "undeletes" any that are in it. */ 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))); delete_all_subwindows (XWINDOW (FRAME_ROOT_WINDOW (f)));
for (k = 0; k < saved_windows->size; k++) for (k = 0; k < saved_windows->size; k++)
...@@ -2423,6 +2428,11 @@ by `current-window-configuration' (which see).") ...@@ -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->left = p->left;
w->top = p->top; w->top = p->top;
w->width = p->width; w->width = p->width;
...@@ -2506,7 +2516,7 @@ static void ...@@ -2506,7 +2516,7 @@ static void
delete_all_subwindows (w) delete_all_subwindows (w)
register struct window *w; register struct window *w;
{ {
register int count = 1; w->height = w->buffer; /* See Fset_window_configuration for excuse. */
w->buffer = Qnil; w->buffer = Qnil;
if (!NILP (w->next)) if (!NILP (w->next))
delete_all_subwindows (XWINDOW (w->next)); delete_all_subwindows (XWINDOW (w->next));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment