aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1992-09-28 06:10:03 +0000
committerJim Blandy1992-09-28 06:10:03 +0000
commit9ace597fcf31409f04cbf01c5e299c2c4c8a3ff1 (patch)
tree06a82d83b695e6c873c70c1cbbb892a8e0f03ba8
parentfde3a52f2427b9afe628f4d1013f020c69052156 (diff)
downloademacs-9ace597fcf31409f04cbf01c5e299c2c4c8a3ff1.tar.gz
emacs-9ace597fcf31409f04cbf01c5e299c2c4c8a3ff1.zip
* 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".
-rw-r--r--src/window.c16
1 files 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).")
2386 if (NILP (XBUFFER (new_current_buffer)->name)) 2386 if (NILP (XBUFFER (new_current_buffer)->name))
2387 new_current_buffer = Qnil; 2387 new_current_buffer = Qnil;
2388 2388
2389 /* Mark all windows now on frame as "deleted". 2389 /* Kludge Alert!
2390 Restoring the new configuration "undeletes" any that are in it. */ 2390 Mark all windows now on frame as "deleted".
2391 Restoring the new configuration "undeletes" any that are in it.
2392
2393 Save their current buffers in their height fields, since we may
2394 need it later, if the buffer saved in the configuration is now
2395 dead. */
2391 delete_all_subwindows (XWINDOW (FRAME_ROOT_WINDOW (f))); 2396 delete_all_subwindows (XWINDOW (FRAME_ROOT_WINDOW (f)));
2392 2397
2393 for (k = 0; k < saved_windows->size; k++) 2398 for (k = 0; k < saved_windows->size; k++)
@@ -2423,6 +2428,11 @@ by `current-window-configuration' (which see).")
2423 } 2428 }
2424 } 2429 }
2425 } 2430 }
2431
2432 /* If we squirreled away the buffer in the window's height,
2433 restore it now. */
2434 if (XTYPE (w->height) == Lisp_Buffer)
2435 w->buffer = w->height;
2426 w->left = p->left; 2436 w->left = p->left;
2427 w->top = p->top; 2437 w->top = p->top;
2428 w->width = p->width; 2438 w->width = p->width;
@@ -2506,7 +2516,7 @@ static void
2506delete_all_subwindows (w) 2516delete_all_subwindows (w)
2507 register struct window *w; 2517 register struct window *w;
2508{ 2518{
2509 register int count = 1; 2519 w->height = w->buffer; /* See Fset_window_configuration for excuse. */
2510 w->buffer = Qnil; 2520 w->buffer = Qnil;
2511 if (!NILP (w->next)) 2521 if (!NILP (w->next))
2512 delete_all_subwindows (XWINDOW (w->next)); 2522 delete_all_subwindows (XWINDOW (w->next));