{
struct frame *f;
Lisp_Object frame, tem;
+ struct frame *sf = SELECTED_FRAME ();
#ifdef MSDOS
- if (selected_frame->output_method != output_msdos_raw)
+ if (sf->output_method != output_msdos_raw)
abort ();
#else /* not MSDOS */
#ifdef macintosh
- if (selected_frame->output_method != output_mac)
+ if (sf->output_method != output_mac)
error ("Not running on a Macintosh screen; cannot make a new Macintosh frame");
#else
- if (selected_frame->output_method != output_termcap)
+ if (sf->output_method != output_termcap)
error ("Not using an ASCII terminal now; cannot make a new ASCII frame");
#endif
#endif /* not MSDOS */
f = make_terminal_frame ();
- change_frame_size (f, FRAME_HEIGHT (selected_frame),
- FRAME_WIDTH (selected_frame), 0, 0, 0);
+ change_frame_size (f, FRAME_HEIGHT (sf),
+ FRAME_WIDTH (sf), 0, 0, 0);
adjust_glyphs (f);
calculate_costs (f);
XSETFRAME (frame, f);
/* Make the frame face alist be frame-specific, so that each
frame could change its face definitions independently. */
- f->face_alist = Fcopy_alist (selected_frame->face_alist);
+ f->face_alist = Fcopy_alist (sf->face_alist);
/* Simple Fcopy_alist isn't enough, because we need the contents of
the vectors which are the CDRs of associations in face_alist to
be copied as well. */
Lisp_Object frame, no_enter;
int track;
{
+ struct frame *sf = SELECTED_FRAME ();
+
/* If FRAME is a switch-frame event, extract the frame we should
switch to. */
if (CONSP (frame)
if (! FRAME_LIVE_P (XFRAME (frame)))
return Qnil;
- if (selected_frame == XFRAME (frame))
+ if (sf == XFRAME (frame))
return frame;
/* This is too greedy; it causes inappropriate focus redirection
focus = FRAME_FOCUS_FRAME (XFRAME (XCONS (tail)->car));
- if (FRAMEP (focus) && XFRAME (focus) == selected_frame)
+ if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ())
Fredirect_frame_focus (XCONS (tail)->car, frame);
}
}
if (FRAMEP (xfocus))
{
focus = FRAME_FOCUS_FRAME (XFRAME (xfocus));
- if (FRAMEP (focus) && XFRAME (focus) == selected_frame)
+ if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ())
Fredirect_frame_focus (xfocus, frame);
}
}
#endif /* HAVE_X_WINDOWS */
#endif /* ! 0 */
- selected_frame = XFRAME (frame);
- if (! FRAME_MINIBUF_ONLY_P (selected_frame))
- last_nonminibuf_frame = selected_frame;
+ selected_frame = frame;
+ if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame)))
+ last_nonminibuf_frame = XFRAME (selected_frame);
Fselect_window (XFRAME (frame)->selected_window);
"Return the frame that is now selected.")
()
{
- Lisp_Object tem;
- XSETFRAME (tem, selected_frame);
- return tem;
+ return selected_frame;
}
\f
DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
Lisp_Object w;
if (NILP (frame))
- w = selected_frame->root_window;
+ w = SELECTED_FRAME ()->root_window;
else
{
CHECK_LIVE_FRAME (frame, 0);
(frame)
Lisp_Object frame;
{
+ Lisp_Object window;
+
if (NILP (frame))
- XSETFRAME (frame, selected_frame);
+ window = SELECTED_FRAME ()->root_window;
else
- CHECK_LIVE_FRAME (frame, 0);
-
- return XFRAME (frame)->root_window;
+ {
+ CHECK_LIVE_FRAME (frame, 0);
+ window = XFRAME (frame)->root_window;
+ }
+
+ return window;
}
DEFUN ("frame-selected-window", Fframe_selected_window,
(frame)
Lisp_Object frame;
{
+ Lisp_Object window;
+
if (NILP (frame))
- XSETFRAME (frame, selected_frame);
+ window = SELECTED_FRAME ()->selected_window;
else
- CHECK_LIVE_FRAME (frame, 0);
+ {
+ CHECK_LIVE_FRAME (frame, 0);
+ window = XFRAME (frame)->selected_window;
+ }
- return XFRAME (frame)->selected_window;
+ return window;
}
DEFUN ("set-frame-selected-window", Fset_frame_selected_window,
Lisp_Object frame, window;
{
if (NILP (frame))
- XSETFRAME (frame, selected_frame);
- else
- CHECK_LIVE_FRAME (frame, 0);
-
+ frame = selected_frame;
+
+ CHECK_LIVE_FRAME (frame, 0);
CHECK_LIVE_WINDOW (window, 1);
if (! EQ (frame, WINDOW_FRAME (XWINDOW (window))))
error ("In `set-frame-selected-window', WINDOW is not on FRAME");
- if (XFRAME (frame) == selected_frame)
+ if (EQ (frame, selected_frame))
return Fselect_window (window);
return XFRAME (frame)->selected_window = window;
Lisp_Object tail;
if (NILP (frame))
- XSETFRAME (frame, selected_frame);
- else
- CHECK_LIVE_FRAME (frame, 0);
-
+ frame = selected_frame;
+
+ CHECK_LIVE_FRAME (frame, 0);
return next_frame (frame, miniframe);
}
Lisp_Object tail;
if (NILP (frame))
- XSETFRAME (frame, selected_frame);
- else
- CHECK_LIVE_FRAME (frame, 0);
-
+ frame = selected_frame;
+ CHECK_LIVE_FRAME (frame, 0);
return prev_frame (frame, miniframe);
}
\f
{
/* We know the selected frame is visible,
so if F is some other frame, it can't be the sole visible one. */
- if (f == selected_frame)
+ if (f == SELECTED_FRAME ())
{
Lisp_Object frames;
int count = 0;
Lisp_Object frame, force;
{
struct frame *f;
+ struct frame *sf = SELECTED_FRAME ();
int minibuffer_selected;
if (EQ (frame, Qnil))
{
- f = selected_frame;
+ f = sf;
XSETFRAME (frame, f);
}
else
minibuffer_selected = EQ (minibuf_window, selected_window);
/* Don't let the frame remain selected. */
- if (f == selected_frame)
+ if (f == sf)
{
Lisp_Object tail, frame1;
/* Don't allow minibuf_window to remain on a deleted frame. */
if (EQ (f->minibuffer_window, minibuf_window))
{
- Fset_window_buffer (selected_frame->minibuffer_window,
+ Fset_window_buffer (sf->minibuffer_window,
XWINDOW (minibuf_window)->buffer);
- minibuf_window = selected_frame->minibuffer_window;
+ minibuf_window = sf->minibuffer_window;
/* If the dying minibuffer window was selected,
select the new one. */
int col, row;
unsigned long long_dummy;
- f = selected_frame;
+ f = SELECTED_FRAME ();
x = y = Qnil;
#ifdef HAVE_MOUSE
int col, row;
unsigned long long_dummy;
- f = selected_frame;
+ f = SELECTED_FRAME ();
x = y = Qnil;
#ifdef HAVE_MOUSE
Lisp_Object frame;
{
if (NILP (frame))
- XSETFRAME (frame, selected_frame);
+ frame = selected_frame;
CHECK_LIVE_FRAME (frame, 0);
Lisp_Object frame, force;
{
if (NILP (frame))
- XSETFRAME (frame, selected_frame);
+ frame = selected_frame;
CHECK_LIVE_FRAME (frame, 0);
#if 0 /* This isn't logically necessary, and it can do GC. */
/* Don't let the frame remain selected. */
- if (XFRAME (frame) == selected_frame)
+ if (EQ (frame, selected_frame))
do_switch_frame (next_frame (frame, Qt), Qnil, 0)
#endif
/* Don't allow minibuf_window to remain on a deleted frame. */
if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
{
- Fset_window_buffer (selected_frame->minibuffer_window,
+ struct frame *sf = XFRAME (selected_frame);
+ Fset_window_buffer (sf->minibuffer_window,
XWINDOW (minibuf_window)->buffer);
- minibuf_window = selected_frame->minibuffer_window;
+ minibuf_window = sf->minibuffer_window;
}
/* I think this should be done with a hook. */
Lisp_Object frame;
{
if (NILP (frame))
- XSETFRAME (frame, selected_frame);
+ frame = selected_frame;
CHECK_LIVE_FRAME (frame, 0);
#if 0 /* This isn't logically necessary, and it can do GC. */
/* Don't let the frame remain selected. */
- if (XFRAME (frame) == selected_frame)
+ if (EQ (frame, selected_frame))
Fhandle_switch_frame (next_frame (frame, Qt), Qnil);
#endif
/* Don't allow minibuf_window to remain on a deleted frame. */
if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
{
- Fset_window_buffer (selected_frame->minibuffer_window,
+ struct frame *sf = XFRAME (selected_frame);
+ Fset_window_buffer (sf->minibuffer_window,
XWINDOW (minibuf_window)->buffer);
- minibuf_window = selected_frame->minibuffer_window;
+ minibuf_window = sf->minibuffer_window;
}
/* I think this should be done with a hook. */
Lisp_Object frame;
{
if (NILP (frame))
- XSETFRAME (frame, selected_frame);
+ frame = selected_frame;
CHECK_LIVE_FRAME (frame, 0);
Lisp_Object frame;
{
if (NILP (frame))
- XSETFRAME (frame, selected_frame);
+ frame = selected_frame;
CHECK_LIVE_FRAME (frame, 0);
int height, width;
if (EQ (frame, Qnil))
- f = selected_frame;
- else
- {
- CHECK_FRAME (frame, 0);
- f = XFRAME (frame);
- }
+ frame = selected_frame;
+
+ CHECK_FRAME (frame, 0);
+ f = XFRAME (frame);
if (!FRAME_LIVE_P (f))
return Qnil;
: FRAME_MINIBUF_WINDOW (f)));
store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
store_in_alist (&alist, Qbuffer_list,
- frame_buffer_list (Fselected_frame ()));
+ frame_buffer_list (selected_frame));
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
register Lisp_Object tail, elt, prop, val;
if (EQ (frame, Qnil))
- f = selected_frame;
- else
- {
- CHECK_LIVE_FRAME (frame, 0);
- f = XFRAME (frame);
- }
+ frame = selected_frame;
+ CHECK_LIVE_FRAME (frame, 0);
+ f = XFRAME (frame);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
struct frame *f;
if (NILP (frame))
- f = selected_frame;
- else
- {
- CHECK_FRAME (frame, 0);
- f = XFRAME (frame);
- }
+ frame = selected_frame;
+ CHECK_FRAME (frame, 0);
+ f = XFRAME (frame);
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
struct frame *f;
if (NILP (frame))
- f = selected_frame;
- else
- {
- CHECK_FRAME (frame, 0);
- f = XFRAME (frame);
- }
+ frame = selected_frame;
+ CHECK_FRAME (frame, 0);
+ f = XFRAME (frame);
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
struct frame *f;
if (NILP (frame))
- f = selected_frame;
- else
- {
- CHECK_FRAME (frame, 0);
- f = XFRAME (frame);
- }
+ frame = selected_frame;
+ CHECK_FRAME (frame, 0);
+ f = XFRAME (frame);
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
struct frame *f;
if (NILP (frame))
- f = selected_frame;
- else
- {
- CHECK_FRAME (frame, 0);
- f = XFRAME (frame);
- }
+ frame = selected_frame;
+ CHECK_FRAME (frame, 0);
+ f = XFRAME (frame);
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
CHECK_NUMBER (lines, 0);
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);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
register struct frame *f;
CHECK_NUMBER (cols, 0);
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);
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM