comparison src/window.c @ 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 55e605674fb1
children 5c66007ecabb
comparison
equal deleted inserted replaced
1236:5e8c234e5f03 1237:3929b2135e58
2384 windows_or_buffers_changed++; 2384 windows_or_buffers_changed++;
2385 new_current_buffer = data->current_buffer; 2385 new_current_buffer = data->current_buffer;
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++)
2394 { 2399 {
2395 p = SAVED_WINDOW_N (saved_windows, k); 2400 p = SAVED_WINDOW_N (saved_windows, k);
2421 XWINDOW (w->parent)->hchild = p->window; 2426 XWINDOW (w->parent)->hchild = p->window;
2422 XWINDOW (w->parent)->vchild = Qnil; 2427 XWINDOW (w->parent)->vchild = Qnil;
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;
2429 w->height = p->height; 2439 w->height = p->height;
2430 w->hscroll = p->hscroll; 2440 w->hscroll = p->hscroll;
2504 2514
2505 static void 2515 static void
2506 delete_all_subwindows (w) 2516 delete_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));
2513 if (!NILP (w->vchild)) 2523 if (!NILP (w->vchild))
2514 delete_all_subwindows (XWINDOW (w->vchild)); 2524 delete_all_subwindows (XWINDOW (w->vchild));