{
Lisp_Object stream;
int kill_emacs_p = 0;
+ struct frame *sf = SELECTED_FRAME ();
Vquit_flag = Qnil;
Vinhibit_quit = Qt;
/* If the window system or terminal frame hasn't been initialized
yet, or we're not interactive, it's best to dump this message out
to stderr and exit. */
- if (!selected_frame->glyphs_initialized_p
+ if (!sf->glyphs_initialized_p
/* This is the case of the frame dumped with Emacs, when we're
running under a window system. */
|| (!NILP (Vwindow_system)
&& !inhibit_window_system
- && FRAME_TERMCAP_P (selected_frame))
+ && FRAME_TERMCAP_P (sf))
|| noninteractive)
{
stream = Qexternal_debugging_output;
while (1)
{
- if (! FRAME_LIVE_P (selected_frame))
+ if (! FRAME_LIVE_P (XFRAME (selected_frame)))
Fkill_emacs (Qnil);
/* Make sure the current window's buffer is selected. */
code swallows a switch-frame event, we'll fix things up here.
Is this a good idea? */
if (FRAMEP (internal_last_event_frame)
- && XFRAME (internal_last_event_frame) != selected_frame)
+ && !EQ (internal_last_event_frame, selected_frame))
Fselect_frame (internal_last_event_frame, Qnil);
#endif
/* If it has changed current-menubar from previous value,
Qnil, 0, 1, 1);
/* A filter may have run while we were reading the input. */
- if (! FRAME_LIVE_P (selected_frame))
+ if (! FRAME_LIVE_P (XFRAME (selected_frame)))
Fkill_emacs (Qnil);
if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer));
if (_setjmp (local_getcjmp))
{
XSETINT (c, quit_char);
- XSETFRAME (internal_last_event_frame, selected_frame);
+ internal_last_event_frame = selected_frame;
Vlast_event_frame = internal_last_event_frame;
/* If we report the quit char as an event,
don't do so more than once. */
#ifdef MULTI_KBOARD
{
- KBOARD *kb = FRAME_KBOARD (selected_frame);
+ KBOARD *kb = FRAME_KBOARD (XFRAME (selected_frame));
if (kb != current_kboard)
{
Lisp_Object *tailp = &kb->kbd_queue;
frame = focus;
if (! EQ (frame, internal_last_event_frame)
- && XFRAME (frame) != selected_frame)
+ && !EQ (frame, selected_frame))
obj = make_lispy_switch_frame (frame);
internal_last_event_frame = frame;
XSETFRAME (frame, f);
if (! EQ (frame, internal_last_event_frame)
- && XFRAME (frame) != selected_frame)
+ && !EQ (frame, selected_frame))
obj = make_lispy_switch_frame (frame);
internal_last_event_frame = frame;
}
cbuf[i] &= ~0x80;
buf[i].code = cbuf[i];
- XSETFRAME (buf[i].frame_or_window, selected_frame);
+ buf[i].frame_or_window = selected_frame;
}
}
int mapno;
register Lisp_Object name;
int nlength;
- int width = FRAME_WIDTH (selected_frame) - 4;
+ int width = FRAME_WIDTH (SELECTED_FRAME ()) - 4;
int idx = -1;
int nobindings = 1;
Lisp_Object rest, vector;
{
#ifdef MULTI_KBOARD
KBOARD *interrupted_kboard = current_kboard;
- struct frame *interrupted_frame = selected_frame;
+ struct frame *interrupted_frame = SELECTED_FRAME ();
if (setjmp (wrong_kboard_jmpbuf))
{
if (!NILP (delayed_switch_frame))
of the command_loop_1. */
if (fix_current_buffer)
{
- if (! FRAME_LIVE_P (selected_frame))
+ if (! FRAME_LIVE_P (XFRAME (selected_frame)))
Fkill_emacs (Qnil);
if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
Fset_buffer (XWINDOW (selected_window)->buffer);
emacsclient). */
record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
- if (! FRAME_LIVE_P (selected_frame))
+ if (! FRAME_LIVE_P (XFRAME (selected_frame)))
Fkill_emacs (Qnil);
set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
orig_local_map = get_local_map (PT, current_buffer);
with a window system; but suspend should be disabled in that case. */
get_frame_size (&width, &height);
if (width != old_width || height != old_height)
- change_frame_size (selected_frame, height, width, 0, 0, 0);
+ change_frame_size (SELECTED_FRAME (), height, width, 0, 0, 0);
/* Run suspend-resume-hook. */
if (!NILP (Vrun_hooks))
char c;
/* Must preserve main program's value of errno. */
int old_errno = errno;
+ struct frame *sf = SELECTED_FRAME ();
#if defined (USG) && !defined (POSIX_SIGNALS)
if (!read_socket_hook && NILP (Vwindow_system))
cancel_echoing ();
if (!NILP (Vquit_flag)
- && (FRAME_TERMCAP_P (selected_frame) || FRAME_MSDOS_P (selected_frame)))
+ && (FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf)))
{
/* If SIGINT isn't blocked, don't let us be interrupted by
another SIGINT, it might be harmful due to non-reentrancy
#endif
#endif
if (FRAMEP (internal_last_event_frame)
- && XFRAME (internal_last_event_frame) != selected_frame)
+ && !EQ (internal_last_event_frame, selected_frame))
do_switch_frame (make_lispy_switch_frame (internal_last_event_frame),
Qnil, 0);