From 4b298d5a3e0d5fb75f66c48598e80122669cef8b Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Wed, 26 Dec 2012 13:40:45 +0400 Subject: [PATCH] * keyboard.c (record_asynch_buffer_change): Initialize an event only if it's really needed. * frame.h (enum output_method): Remove output_mac member since it's a leftover from the deleted code. * frame.c (Fframep): Adjust user here ... * terminal.c (Fterminal_live_p): ... and here. * coding.c (Qmac): Now here because it's only used to denote end-of-line encoding type. (syms_of_coding): DEFSYM it. * frame.h (Qmac): Remove duplicated declaration. --- src/ChangeLog | 13 +++++++++++++ src/coding.c | 3 ++- src/frame.c | 4 +--- src/frame.h | 3 +-- src/keyboard.c | 38 ++++++++++++++++++-------------------- src/terminal.c | 2 -- 6 files changed, 35 insertions(+), 28 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 91fa2cb5f6..8a22821450 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2012-12-26 Dmitry Antipov + + * keyboard.c (record_asynch_buffer_change): Initialize an event + only if it's really needed. + * frame.h (enum output_method): Remove output_mac member since + it's a leftover from the deleted code. + * frame.c (Fframep): Adjust user here ... + * terminal.c (Fterminal_live_p): ... and here. + * coding.c (Qmac): Now here because it's only used to denote + end-of-line encoding type. + (syms_of_coding): DEFSYM it. + * frame.h (Qmac): Remove duplicated declaration. + 2012-12-26 Paul Eggert * window.c (select_window_1): Now static, since it's used only here. diff --git a/src/coding.c b/src/coding.c index e42461f52a..2c1139ec5f 100644 --- a/src/coding.c +++ b/src/coding.c @@ -301,7 +301,7 @@ Lisp_Object Vcoding_system_hash_table; static Lisp_Object Qcoding_system, Qeol_type; static Lisp_Object Qcoding_aliases; -Lisp_Object Qunix, Qdos; +Lisp_Object Qunix, Qdos, Qmac; Lisp_Object Qbuffer_file_coding_system; static Lisp_Object Qpost_read_conversion, Qpre_write_conversion; static Lisp_Object Qdefault_char; @@ -10303,6 +10303,7 @@ syms_of_coding (void) DEFSYM (Qeol_type, "eol-type"); DEFSYM (Qunix, "unix"); DEFSYM (Qdos, "dos"); + DEFSYM (Qmac, "mac"); DEFSYM (Qbuffer_file_coding_system, "buffer-file-coding-system"); DEFSYM (Qpost_read_conversion, "post-read-conversion"); diff --git a/src/frame.c b/src/frame.c index 5cefad6ca4..a52394e481 100644 --- a/src/frame.c +++ b/src/frame.c @@ -60,7 +60,7 @@ Lisp_Object Qns_parse_geometry; Lisp_Object Qframep, Qframe_live_p; Lisp_Object Qicon, Qmodeline; Lisp_Object Qonly, Qnone; -Lisp_Object Qx, Qw32, Qmac, Qpc, Qns; +Lisp_Object Qx, Qw32, Qpc, Qns; Lisp_Object Qvisible; Lisp_Object Qdisplay_type; static Lisp_Object Qbackground_mode; @@ -225,8 +225,6 @@ See also `frame-live-p'. */) return Qw32; case output_msdos_raw: return Qpc; - case output_mac: - return Qmac; case output_ns: return Qns; default: diff --git a/src/frame.h b/src/frame.h index 589b45fc0f..74350b9712 100644 --- a/src/frame.h +++ b/src/frame.h @@ -46,7 +46,6 @@ enum output_method output_x_window, output_msdos_raw, output_w32, - output_mac, output_ns }; @@ -1178,7 +1177,7 @@ extern Lisp_Object Qalpha; extern Lisp_Object Qleft_fringe, Qright_fringe; extern Lisp_Object Qheight, Qwidth; extern Lisp_Object Qminibuffer, Qmodeline; -extern Lisp_Object Qx, Qw32, Qmac, Qpc, Qns; +extern Lisp_Object Qx, Qw32, Qpc, Qns; extern Lisp_Object Qvisible; extern Lisp_Object Qdisplay_type; diff --git a/src/keyboard.c b/src/keyboard.c index e2a0e23dd4..582c359871 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -6700,37 +6700,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. diff --git a/src/terminal.c b/src/terminal.c index 854ca61f19..5eaaeb4588 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -398,8 +398,6 @@ possible return values. */) return Qw32; case output_msdos_raw: return Qpc; - case output_mac: - return Qmac; case output_ns: return Qns; default: -- 2.20.1