# HG changeset patch # User Gerd Moellmann # Date 937221216 0 # Node ID 1406380bf1e64988612797304753098ed5d2d7bc # Parent 728844445e1cc99fdb60128eaca13d44fdd63d44 (command_loop_1): Change for Lisp_Object selected_frame. (cmd_error_internal, command_loop_1, read_char, kbd_buffer_get_event, read_avail_input, read_char_minibuf_menu_prompt, read_key_sequence, Fsuspend_emacs, interrupt_signal, quit_throw_to_read_char): Ditto. diff -r 728844445e1c -r 1406380bf1e6 src/keyboard.c --- a/src/keyboard.c Mon Sep 13 11:13:35 1999 +0000 +++ b/src/keyboard.c Mon Sep 13 11:13:36 1999 +0000 @@ -1037,6 +1037,7 @@ { Lisp_Object stream; int kill_emacs_p = 0; + struct frame *sf = SELECTED_FRAME (); Vquit_flag = Qnil; Vinhibit_quit = Qt; @@ -1045,12 +1046,12 @@ /* 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; @@ -1237,7 +1238,7 @@ 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. */ @@ -1292,7 +1293,7 @@ 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, @@ -1312,7 +1313,7 @@ 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)); @@ -2018,7 +2019,7 @@ 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. */ @@ -2027,7 +2028,7 @@ #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; @@ -3178,7 +3179,7 @@ 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; @@ -3241,7 +3242,7 @@ 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; } @@ -5626,7 +5627,7 @@ cbuf[i] &= ~0x80; buf[i].code = cbuf[i]; - XSETFRAME (buf[i].frame_or_window, selected_frame); + buf[i].frame_or_window = selected_frame; } } @@ -6902,7 +6903,7 @@ 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; @@ -7541,7 +7542,7 @@ { #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)) @@ -7609,7 +7610,7 @@ 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); @@ -7712,7 +7713,7 @@ 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); @@ -9022,7 +9023,7 @@ 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)) @@ -9115,6 +9116,7 @@ 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)) @@ -9129,7 +9131,7 @@ 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 @@ -9272,7 +9274,7 @@ #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);