Lisp_Object frame;
{
if (NILP (frame))
- XSETFRAME (frame, selected_frame);
- else
- CHECK_LIVE_FRAME (frame, 0);
-
+ frame = selected_frame;
+ CHECK_LIVE_FRAME (frame, 0);
return FRAME_MINIBUF_WINDOW (XFRAME (frame));
}
struct frame *f;
if (NILP (frame))
- XSETFRAME (frame, selected_frame);
- else
- CHECK_LIVE_FRAME (frame, 2);
+ frame = selected_frame;
+ CHECK_LIVE_FRAME (frame, 2);
f = XFRAME (frame);
/* Check that arguments are integers or floats. */
If that happens, go back to the selected frame
so we can complete the cycle. */
if (EQ (tem, tem1))
- XSETFRAME (tem, selected_frame);
+ tem = selected_frame;
}
tem = FRAME_ROOT_WINDOW (XFRAME (tem));
If that happens, go back to the selected frame
so we can complete the cycle. */
if (EQ (tem, tem1))
- XSETFRAME (tem, selected_frame);
+ tem = selected_frame;
}
/* If this frame has a minibuffer, find that window first,
because it is conceptually the last window in that frame. */
if (FRAMEP (frames))
frame = XFRAME (frames);
else if (NILP (frames))
- frame = selected_frame;
+ frame = SELECTED_FRAME ();
else
frame = 0;
if (frame)
else if (frame)
w = FRAME_SELECTED_WINDOW (frame);
else
- w = FRAME_SELECTED_WINDOW (selected_frame);
+ w = FRAME_SELECTED_WINDOW (SELECTED_FRAME ());
/* Figure out the last window we're going to mess with. Since
Fnext_window, given the same options, is guaranteed to go in a
{
register struct window *w;
register struct window *ow = XWINDOW (selected_window);
+ struct frame *sf;
CHECK_LIVE_WINDOW (window, 0);
BUF_PT_BYTE (XBUFFER (ow->buffer)));
selected_window = window;
- if (XFRAME (WINDOW_FRAME (w)) != selected_frame)
+ sf = SELECTED_FRAME ();
+ if (XFRAME (WINDOW_FRAME (w)) != sf)
{
XFRAME (WINDOW_FRAME (w))->selected_window = window;
/* Use this rather than Fhandle_switch_frame
Fselect_frame (WINDOW_FRAME (w), Qnil);
}
else
- selected_frame->selected_window = window;
+ sf->selected_window = window;
if (recordflag)
record_buffer (w->buffer);
display_buffer_1 (window)
Lisp_Object window;
{
- FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
+ Lisp_Object frame = XWINDOW (window)->frame;
+ FRAME_PTR f = XFRAME (frame);
+
FRAME_SAMPLE_VISIBILITY (f);
- if (f != selected_frame)
+
+ if (!EQ (frame, selected_frame))
{
if (FRAME_ICONIFIED_P (f))
- Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window)));
+ Fmake_frame_visible (frame);
else if (FRAME_VISIBLE_P (f))
- Fraise_frame (WINDOW_FRAME (XWINDOW (window)));
+ Fraise_frame (frame);
}
+
return window;
}
register Lisp_Object buffer, not_this_window, frame;
{
register Lisp_Object window, tem, swp;
+ struct frame *f;
swp = Qnil;
buffer = Fget_buffer (buffer);
return display_buffer_1 (window);
}
+ f = SELECTED_FRAME ();
if (pop_up_windows
- || FRAME_MINIBUF_ONLY_P (selected_frame)
+ || FRAME_MINIBUF_ONLY_P (f)
/* If the current frame is a special display frame,
don't try to reuse its windows. */
- || !NILP (XWINDOW (FRAME_ROOT_WINDOW (selected_frame))->dedicated)
- )
+ || !NILP (XWINDOW (FRAME_ROOT_WINDOW (f))->dedicated))
{
Lisp_Object frames;
frames = Qnil;
- if (FRAME_MINIBUF_ONLY_P (selected_frame))
+ if (FRAME_MINIBUF_ONLY_P (f))
XSETFRAME (frames, last_nonminibuf_frame);
/* Don't try to create a window if would get an error */
if (split_height_threshold < window_min_height << 1)
/* If the frame we would try to split cannot be split,
try other frames. */
- if (FRAME_NO_SPLIT_P (NILP (frames) ? selected_frame
- : last_nonminibuf_frame))
+ if (FRAME_NO_SPLIT_P (NILP (frames) ? f : last_nonminibuf_frame))
{
/* Try visible frames first. */
window = Fget_largest_window (Qvisible);
{
window = Fdisplay_buffer (buf, Qnil, Qnil);
- if (XFRAME (XWINDOW (window)->frame) != selected_frame)
+ if (!EQ (XWINDOW (window)->frame, selected_frame))
Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window)));
Vminibuf_scroll_window = window;
w = XWINDOW (window);
FRAME_PTR f;
if (NILP (frame))
- f = selected_frame;
- else
- {
- CHECK_LIVE_FRAME (frame, 0);
- f = XFRAME (frame);
- }
+ frame = selected_frame;
+ CHECK_LIVE_FRAME (frame, 0);
+ f = XFRAME (frame);
n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f)));
vec = allocate_vectorlike (VECSIZE (struct save_window_data));
XSETFASTINT (data->frame_height, FRAME_HEIGHT (f));
XSETFASTINT (data->frame_menu_bar_lines, FRAME_MENU_BAR_LINES (f));
XSETFASTINT (data->frame_tool_bar_lines, FRAME_TOOL_BAR_LINES (f));
- XSETFRAME (data->selected_frame, selected_frame);
+ data->selected_frame = selected_frame;
data->current_window = FRAME_SELECTED_WINDOW (f);
XSETBUFFER (data->current_buffer, current_buffer);
data->minibuf_scroll_window = Vminibuf_scroll_window;
void
init_window_once ()
{
- selected_frame = make_terminal_frame ();
- XSETFRAME (Vterminal_frame, selected_frame);
- minibuf_window = selected_frame->minibuffer_window;
- selected_window = selected_frame->selected_window;
- last_nonminibuf_frame = selected_frame;
+ struct frame *f = make_terminal_frame ();
+ XSETFRAME (selected_frame, f);
+ Vterminal_frame = selected_frame;
+ minibuf_window = f->minibuffer_window;
+ selected_window = f->selected_window;
+ last_nonminibuf_frame = f;
window_initialized = 1;
}