diff options
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index e2a0e23dd4a..8edd705135f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1,6 +1,7 @@ /* Keyboard and mouse input; editor command loop. -Copyright (C) 1985-1989, 1993-1997, 1999-2012 Free Software Foundation, Inc. +Copyright (C) 1985-1989, 1993-1997, 1999-2013 Free Software Foundation, +Inc. This file is part of GNU Emacs. @@ -6700,37 +6701,35 @@ get_input_pending (int flags) void record_asynch_buffer_change (void) { - struct input_event event; - Lisp_Object tem; - EVENT_INIT (event); - - event.kind = BUFFER_SWITCH_EVENT; - event.frame_or_window = Qnil; - event.arg = Qnil; - /* We don't need a buffer-switch event unless Emacs is waiting for input. The purpose of the event is to make read_key_sequence look up the keymaps again. If we aren't in read_key_sequence, we don't need one, and the event could cause trouble by messing up (input-pending-p). Note: Fwaiting_for_user_input_p always returns nil when async subprocesses aren't supported. */ - tem = Fwaiting_for_user_input_p (); - if (NILP (tem)) - return; + if (!NILP (Fwaiting_for_user_input_p ())) + { + struct input_event event; + + EVENT_INIT (event); + event.kind = BUFFER_SWITCH_EVENT; + event.frame_or_window = Qnil; + event.arg = Qnil; - /* Make sure no interrupt happens while storing the event. */ + /* Make sure no interrupt happens while storing the event. */ #ifdef USABLE_SIGIO - if (interrupt_input) - kbd_buffer_store_event (&event); - else + if (interrupt_input) + kbd_buffer_store_event (&event); + else #endif - { - stop_polling (); - kbd_buffer_store_event (&event); - start_polling (); + { + stop_polling (); + kbd_buffer_store_event (&event); + start_polling (); + } } } - + /* Read any terminal input already buffered up by the system into the kbd_buffer, but do not wait. |
