Mercurial > emacs
comparison src/window.c @ 1016:817b0ce337d7
* window.c (Fset_window_configuration): Removed #if 0'd code which
assumes that minibuf_window is on the same frame as the window
configuration. Removed special case for windows whose prevs
point to themselves.
* window.c (Fset_window_configuration): Rename the argument from
ARG to CONFIGURATION, so it matches the docstring. The
make-docfile program cares.
* window.c [MULTI_FRAME] (syms_of_window): Don't staticpro
minibuf_window; the frame list will take care of it.
* window.c (window_loop): This used to keep track of the first
window processed and wait until we came back around to it. Sadly,
this doesn't work if that window gets deleted. So instead, use
Fprevious_window to find the last window to process, and loop
until we've done that one.
* window.c [not MULTI_FRAME] (init_window_once): Don't forget to
set the `mini_p' flag on the new minibuffer window to t.
* window.c (Fwindow_at): Don't check the type of the frame
argument.
* window.c [not MULTI_FRAME] (window_loop): Set frame to zero,
instead of trying to decode it.
* window.c (init_window_once): Initialize minibuf_window before
FRAME_ROOT_WINDOW, so the latter actually points to something.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Wed, 19 Aug 1992 06:40:02 +0000 |
parents | eb19dfaec9c4 |
children | 25046e48ce9a |
comparison
equal
deleted
inserted
replaced
1015:58c373be762c | 1016:817b0ce337d7 |
---|---|
2331 Fset_window_configuration, Sset_window_configuration, | 2331 Fset_window_configuration, Sset_window_configuration, |
2332 1, 1, 0, | 2332 1, 1, 0, |
2333 "Set the configuration of windows and buffers as specified by CONFIGURATION.\n\ | 2333 "Set the configuration of windows and buffers as specified by CONFIGURATION.\n\ |
2334 CONFIGURATION must be a value previously returned\n\ | 2334 CONFIGURATION must be a value previously returned\n\ |
2335 by `current-window-configuration' (which see).") | 2335 by `current-window-configuration' (which see).") |
2336 (arg) | 2336 (configuration) |
2337 Lisp_Object arg; | 2337 Lisp_Object configuration; |
2338 { | 2338 { |
2339 register struct window *w; | 2339 register struct window *w; |
2340 register struct save_window_data *data; | 2340 register struct save_window_data *data; |
2341 struct Lisp_Vector *saved_windows; | 2341 struct Lisp_Vector *saved_windows; |
2342 register struct saved_window *p; | 2342 register struct saved_window *p; |
2343 register Lisp_Object tem; | 2343 register Lisp_Object tem; |
2344 Lisp_Object new_current_buffer; | 2344 Lisp_Object new_current_buffer; |
2345 int k; | 2345 int k; |
2346 FRAME_PTR f; | 2346 FRAME_PTR f; |
2347 | 2347 |
2348 while (XTYPE (arg) != Lisp_Window_Configuration) | 2348 while (XTYPE (configuration) != Lisp_Window_Configuration) |
2349 { | 2349 { |
2350 arg = wrong_type_argument (intern ("window-configuration-p"), arg); | 2350 configuration = wrong_type_argument (intern ("window-configuration-p"), |
2351 } | 2351 configuration); |
2352 | 2352 } |
2353 data = (struct save_window_data *) XVECTOR (arg); | 2353 |
2354 data = (struct save_window_data *) XVECTOR (configuration); | |
2354 saved_windows = XVECTOR (data->saved_windows); | 2355 saved_windows = XVECTOR (data->saved_windows); |
2355 | 2356 |
2356 f = XFRAME (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame); | 2357 f = XFRAME (XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame); |
2357 | 2358 |
2358 if (XFASTINT (data->frame_height) != FRAME_HEIGHT (f) | 2359 if (XFASTINT (data->frame_height) != FRAME_HEIGHT (f) |
2370 if (NILP (XBUFFER (new_current_buffer)->name)) | 2371 if (NILP (XBUFFER (new_current_buffer)->name)) |
2371 new_current_buffer = Qnil; | 2372 new_current_buffer = Qnil; |
2372 | 2373 |
2373 /* Mark all windows now on frame as "deleted". | 2374 /* Mark all windows now on frame as "deleted". |
2374 Restoring the new configuration "undeletes" any that are in it. */ | 2375 Restoring the new configuration "undeletes" any that are in it. */ |
2375 | |
2376 delete_all_subwindows (XWINDOW (FRAME_ROOT_WINDOW (f))); | 2376 delete_all_subwindows (XWINDOW (FRAME_ROOT_WINDOW (f))); |
2377 #if 0 | |
2378 /* This loses when the minibuf frame is not f. */ | |
2379 delete_all_subwindows (XWINDOW (XWINDOW (minibuf_window)->prev)); | |
2380 #endif | |
2381 | 2377 |
2382 for (k = 0; k < saved_windows->size; k++) | 2378 for (k = 0; k < saved_windows->size; k++) |
2383 { | 2379 { |
2384 p = SAVED_WINDOW_N (saved_windows, k); | 2380 p = SAVED_WINDOW_N (saved_windows, k); |
2385 w = XWINDOW (p->window); | 2381 w = XWINDOW (p->window); |
2391 w->parent = Qnil; | 2387 w->parent = Qnil; |
2392 | 2388 |
2393 if (!NILP (p->prev)) | 2389 if (!NILP (p->prev)) |
2394 { | 2390 { |
2395 w->prev = SAVED_WINDOW_N (saved_windows, XFASTINT (p->prev))->window; | 2391 w->prev = SAVED_WINDOW_N (saved_windows, XFASTINT (p->prev))->window; |
2396 #ifdef MULTI_FRAME | 2392 XWINDOW (w->prev)->next = p->window; |
2397 /* This is true for a minibuffer-only frame. */ | |
2398 if (w->mini_p && EQ (w->prev, p->window)) | |
2399 w->next = Qnil; | |
2400 else | |
2401 #endif /* MULTI_FRAME */ | |
2402 XWINDOW (w->prev)->next = p->window; | |
2403 } | 2393 } |
2404 else | 2394 else |
2405 { | 2395 { |
2406 w->prev = Qnil; | 2396 w->prev = Qnil; |
2407 if (!NILP (w->parent)) | 2397 if (!NILP (w->parent)) |
2705 syms_of_window () | 2695 syms_of_window () |
2706 { | 2696 { |
2707 Qwindowp = intern ("windowp"); | 2697 Qwindowp = intern ("windowp"); |
2708 staticpro (&Qwindowp); | 2698 staticpro (&Qwindowp); |
2709 | 2699 |
2700 #ifndef MULTI_FRAME | |
2710 /* Make sure all windows get marked */ | 2701 /* Make sure all windows get marked */ |
2711 staticpro (&minibuf_window); | 2702 staticpro (&minibuf_window); |
2703 #endif | |
2712 | 2704 |
2713 DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, | 2705 DEFVAR_LISP ("temp-buffer-show-function", &Vtemp_buffer_show_function, |
2714 "Non-nil means call as function to display a help buffer.\n\ | 2706 "Non-nil means call as function to display a help buffer.\n\ |
2715 Used by `with-output-to-temp-buffer'."); | 2707 Used by `with-output-to-temp-buffer'."); |
2716 Vtemp_buffer_show_function = Qnil; | 2708 Vtemp_buffer_show_function = Qnil; |