aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorGerd Moellmann1999-09-13 11:13:55 +0000
committerGerd Moellmann1999-09-13 11:13:55 +0000
commit1ae1a37dc5c50b07d4ba68a48b693d844ff47f2c (patch)
tree6d9de077102ab7f83dd9cd8ed51d1ff966da2178 /src/window.c
parente52f4e084a6875a4f96f58669b3774e7bf98306b (diff)
downloademacs-1ae1a37dc5c50b07d4ba68a48b693d844ff47f2c.tar.gz
emacs-1ae1a37dc5c50b07d4ba68a48b693d844ff47f2c.zip
(Fminibuffer_window): Change for Lisp_Object
selected_frame. (Fwindow_at, Fprevious_window, window_loop, select_window_1, display_buffer_1, Fdisplay_buffer, temp_output_buffer_show, Fcurrent_window_configuration, init_window_once): Ditto.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c73
1 files changed, 37 insertions, 36 deletions
diff --git a/src/window.c b/src/window.c
index d8bb7cdd699..663b8045a75 100644
--- a/src/window.c
+++ b/src/window.c
@@ -248,10 +248,8 @@ used by that frame.")
248 Lisp_Object frame; 248 Lisp_Object frame;
249{ 249{
250 if (NILP (frame)) 250 if (NILP (frame))
251 XSETFRAME (frame, selected_frame); 251 frame = selected_frame;
252 else 252 CHECK_LIVE_FRAME (frame, 0);
253 CHECK_LIVE_FRAME (frame, 0);
254
255 return FRAME_MINIBUF_WINDOW (XFRAME (frame)); 253 return FRAME_MINIBUF_WINDOW (XFRAME (frame));
256} 254}
257 255
@@ -634,9 +632,8 @@ column 0.")
634 struct frame *f; 632 struct frame *f;
635 633
636 if (NILP (frame)) 634 if (NILP (frame))
637 XSETFRAME (frame, selected_frame); 635 frame = selected_frame;
638 else 636 CHECK_LIVE_FRAME (frame, 2);
639 CHECK_LIVE_FRAME (frame, 2);
640 f = XFRAME (frame); 637 f = XFRAME (frame);
641 638
642 /* Check that arguments are integers or floats. */ 639 /* Check that arguments are integers or floats. */
@@ -1213,7 +1210,7 @@ DEFUN ("next-window", Fnext_window, Snext_window, 0, 3, 0,
1213 If that happens, go back to the selected frame 1210 If that happens, go back to the selected frame
1214 so we can complete the cycle. */ 1211 so we can complete the cycle. */
1215 if (EQ (tem, tem1)) 1212 if (EQ (tem, tem1))
1216 XSETFRAME (tem, selected_frame); 1213 tem = selected_frame;
1217 } 1214 }
1218 tem = FRAME_ROOT_WINDOW (XFRAME (tem)); 1215 tem = FRAME_ROOT_WINDOW (XFRAME (tem));
1219 1216
@@ -1365,7 +1362,7 @@ DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 3, 0,
1365 If that happens, go back to the selected frame 1362 If that happens, go back to the selected frame
1366 so we can complete the cycle. */ 1363 so we can complete the cycle. */
1367 if (EQ (tem, tem1)) 1364 if (EQ (tem, tem1))
1368 XSETFRAME (tem, selected_frame); 1365 tem = selected_frame;
1369 } 1366 }
1370 /* If this frame has a minibuffer, find that window first, 1367 /* If this frame has a minibuffer, find that window first,
1371 because it is conceptually the last window in that frame. */ 1368 because it is conceptually the last window in that frame. */
@@ -1476,7 +1473,7 @@ window_loop (type, obj, mini, frames)
1476 if (FRAMEP (frames)) 1473 if (FRAMEP (frames))
1477 frame = XFRAME (frames); 1474 frame = XFRAME (frames);
1478 else if (NILP (frames)) 1475 else if (NILP (frames))
1479 frame = selected_frame; 1476 frame = SELECTED_FRAME ();
1480 else 1477 else
1481 frame = 0; 1478 frame = 0;
1482 if (frame) 1479 if (frame)
@@ -1496,7 +1493,7 @@ window_loop (type, obj, mini, frames)
1496 else if (frame) 1493 else if (frame)
1497 w = FRAME_SELECTED_WINDOW (frame); 1494 w = FRAME_SELECTED_WINDOW (frame);
1498 else 1495 else
1499 w = FRAME_SELECTED_WINDOW (selected_frame); 1496 w = FRAME_SELECTED_WINDOW (SELECTED_FRAME ());
1500 1497
1501 /* Figure out the last window we're going to mess with. Since 1498 /* Figure out the last window we're going to mess with. Since
1502 Fnext_window, given the same options, is guaranteed to go in a 1499 Fnext_window, given the same options, is guaranteed to go in a
@@ -2450,6 +2447,7 @@ select_window_1 (window, recordflag)
2450{ 2447{
2451 register struct window *w; 2448 register struct window *w;
2452 register struct window *ow = XWINDOW (selected_window); 2449 register struct window *ow = XWINDOW (selected_window);
2450 struct frame *sf;
2453 2451
2454 CHECK_LIVE_WINDOW (window, 0); 2452 CHECK_LIVE_WINDOW (window, 0);
2455 2453
@@ -2468,7 +2466,8 @@ select_window_1 (window, recordflag)
2468 BUF_PT_BYTE (XBUFFER (ow->buffer))); 2466 BUF_PT_BYTE (XBUFFER (ow->buffer)));
2469 2467
2470 selected_window = window; 2468 selected_window = window;
2471 if (XFRAME (WINDOW_FRAME (w)) != selected_frame) 2469 sf = SELECTED_FRAME ();
2470 if (XFRAME (WINDOW_FRAME (w)) != sf)
2472 { 2471 {
2473 XFRAME (WINDOW_FRAME (w))->selected_window = window; 2472 XFRAME (WINDOW_FRAME (w))->selected_window = window;
2474 /* Use this rather than Fhandle_switch_frame 2473 /* Use this rather than Fhandle_switch_frame
@@ -2478,7 +2477,7 @@ select_window_1 (window, recordflag)
2478 Fselect_frame (WINDOW_FRAME (w), Qnil); 2477 Fselect_frame (WINDOW_FRAME (w), Qnil);
2479 } 2478 }
2480 else 2479 else
2481 selected_frame->selected_window = window; 2480 sf->selected_window = window;
2482 2481
2483 if (recordflag) 2482 if (recordflag)
2484 record_buffer (w->buffer); 2483 record_buffer (w->buffer);
@@ -2519,15 +2518,19 @@ static Lisp_Object
2519display_buffer_1 (window) 2518display_buffer_1 (window)
2520 Lisp_Object window; 2519 Lisp_Object window;
2521{ 2520{
2522 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (window))); 2521 Lisp_Object frame = XWINDOW (window)->frame;
2522 FRAME_PTR f = XFRAME (frame);
2523
2523 FRAME_SAMPLE_VISIBILITY (f); 2524 FRAME_SAMPLE_VISIBILITY (f);
2524 if (f != selected_frame) 2525
2526 if (!EQ (frame, selected_frame))
2525 { 2527 {
2526 if (FRAME_ICONIFIED_P (f)) 2528 if (FRAME_ICONIFIED_P (f))
2527 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); 2529 Fmake_frame_visible (frame);
2528 else if (FRAME_VISIBLE_P (f)) 2530 else if (FRAME_VISIBLE_P (f))
2529 Fraise_frame (WINDOW_FRAME (XWINDOW (window))); 2531 Fraise_frame (frame);
2530 } 2532 }
2533
2531 return window; 2534 return window;
2532} 2535}
2533 2536
@@ -2624,6 +2627,7 @@ If FRAME is nil, search only the selected frame\n\
2624 register Lisp_Object buffer, not_this_window, frame; 2627 register Lisp_Object buffer, not_this_window, frame;
2625{ 2628{
2626 register Lisp_Object window, tem, swp; 2629 register Lisp_Object window, tem, swp;
2630 struct frame *f;
2627 2631
2628 swp = Qnil; 2632 swp = Qnil;
2629 buffer = Fget_buffer (buffer); 2633 buffer = Fget_buffer (buffer);
@@ -2683,17 +2687,17 @@ If FRAME is nil, search only the selected frame\n\
2683 return display_buffer_1 (window); 2687 return display_buffer_1 (window);
2684 } 2688 }
2685 2689
2690 f = SELECTED_FRAME ();
2686 if (pop_up_windows 2691 if (pop_up_windows
2687 || FRAME_MINIBUF_ONLY_P (selected_frame) 2692 || FRAME_MINIBUF_ONLY_P (f)
2688 /* If the current frame is a special display frame, 2693 /* If the current frame is a special display frame,
2689 don't try to reuse its windows. */ 2694 don't try to reuse its windows. */
2690 || !NILP (XWINDOW (FRAME_ROOT_WINDOW (selected_frame))->dedicated) 2695 || !NILP (XWINDOW (FRAME_ROOT_WINDOW (f))->dedicated))
2691 )
2692 { 2696 {
2693 Lisp_Object frames; 2697 Lisp_Object frames;
2694 2698
2695 frames = Qnil; 2699 frames = Qnil;
2696 if (FRAME_MINIBUF_ONLY_P (selected_frame)) 2700 if (FRAME_MINIBUF_ONLY_P (f))
2697 XSETFRAME (frames, last_nonminibuf_frame); 2701 XSETFRAME (frames, last_nonminibuf_frame);
2698 /* Don't try to create a window if would get an error */ 2702 /* Don't try to create a window if would get an error */
2699 if (split_height_threshold < window_min_height << 1) 2703 if (split_height_threshold < window_min_height << 1)
@@ -2705,8 +2709,7 @@ If FRAME is nil, search only the selected frame\n\
2705 2709
2706 /* If the frame we would try to split cannot be split, 2710 /* If the frame we would try to split cannot be split,
2707 try other frames. */ 2711 try other frames. */
2708 if (FRAME_NO_SPLIT_P (NILP (frames) ? selected_frame 2712 if (FRAME_NO_SPLIT_P (NILP (frames) ? f : last_nonminibuf_frame))
2709 : last_nonminibuf_frame))
2710 { 2713 {
2711 /* Try visible frames first. */ 2714 /* Try visible frames first. */
2712 window = Fget_largest_window (Qvisible); 2715 window = Fget_largest_window (Qvisible);
@@ -2816,7 +2819,7 @@ temp_output_buffer_show (buf)
2816 { 2819 {
2817 window = Fdisplay_buffer (buf, Qnil, Qnil); 2820 window = Fdisplay_buffer (buf, Qnil, Qnil);
2818 2821
2819 if (XFRAME (XWINDOW (window)->frame) != selected_frame) 2822 if (!EQ (XWINDOW (window)->frame, selected_frame))
2820 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); 2823 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window)));
2821 Vminibuf_scroll_window = window; 2824 Vminibuf_scroll_window = window;
2822 w = XWINDOW (window); 2825 w = XWINDOW (window);
@@ -4511,12 +4514,9 @@ redirection (see `redirect-frame-focus').")
4511 FRAME_PTR f; 4514 FRAME_PTR f;
4512 4515
4513 if (NILP (frame)) 4516 if (NILP (frame))
4514 f = selected_frame; 4517 frame = selected_frame;
4515 else 4518 CHECK_LIVE_FRAME (frame, 0);
4516 { 4519 f = XFRAME (frame);
4517 CHECK_LIVE_FRAME (frame, 0);
4518 f = XFRAME (frame);
4519 }
4520 4520
4521 n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f))); 4521 n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f)));
4522 vec = allocate_vectorlike (VECSIZE (struct save_window_data)); 4522 vec = allocate_vectorlike (VECSIZE (struct save_window_data));
@@ -4529,7 +4529,7 @@ redirection (see `redirect-frame-focus').")
4529 XSETFASTINT (data->frame_height, FRAME_HEIGHT (f)); 4529 XSETFASTINT (data->frame_height, FRAME_HEIGHT (f));
4530 XSETFASTINT (data->frame_menu_bar_lines, FRAME_MENU_BAR_LINES (f)); 4530 XSETFASTINT (data->frame_menu_bar_lines, FRAME_MENU_BAR_LINES (f));
4531 XSETFASTINT (data->frame_tool_bar_lines, FRAME_TOOL_BAR_LINES (f)); 4531 XSETFASTINT (data->frame_tool_bar_lines, FRAME_TOOL_BAR_LINES (f));
4532 XSETFRAME (data->selected_frame, selected_frame); 4532 data->selected_frame = selected_frame;
4533 data->current_window = FRAME_SELECTED_WINDOW (f); 4533 data->current_window = FRAME_SELECTED_WINDOW (f);
4534 XSETBUFFER (data->current_buffer, current_buffer); 4534 XSETBUFFER (data->current_buffer, current_buffer);
4535 data->minibuf_scroll_window = Vminibuf_scroll_window; 4535 data->minibuf_scroll_window = Vminibuf_scroll_window;
@@ -4890,11 +4890,12 @@ and scrolling positions.")
4890void 4890void
4891init_window_once () 4891init_window_once ()
4892{ 4892{
4893 selected_frame = make_terminal_frame (); 4893 struct frame *f = make_terminal_frame ();
4894 XSETFRAME (Vterminal_frame, selected_frame); 4894 XSETFRAME (selected_frame, f);
4895 minibuf_window = selected_frame->minibuffer_window; 4895 Vterminal_frame = selected_frame;
4896 selected_window = selected_frame->selected_window; 4896 minibuf_window = f->minibuffer_window;
4897 last_nonminibuf_frame = selected_frame; 4897 selected_window = f->selected_window;
4898 last_nonminibuf_frame = f;
4898 4899
4899 window_initialized = 1; 4900 window_initialized = 1;
4900} 4901}