* keyboard.c (record_asynch_buffer_change): Initialize an event
authorDmitry Antipov <dmantipov@yandex.ru>
Wed, 26 Dec 2012 09:40:45 +0000 (13:40 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Wed, 26 Dec 2012 09:40:45 +0000 (13:40 +0400)
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
src/coding.c
src/frame.c
src/frame.h
src/keyboard.c
src/terminal.c

index 91fa2cb..8a22821 100644 (file)
@@ -1,3 +1,16 @@
+2012-12-26  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * 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  <eggert@cs.ucla.edu>
 
        * window.c (select_window_1): Now static, since it's used only here.
index e42461f..2c1139e 100644 (file)
@@ -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");
index 5cefad6..a52394e 100644 (file)
@@ -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:
index 589b45f..74350b9 100644 (file)
@@ -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;
 
index e2a0e23..582c359 100644 (file)
@@ -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 ();
+       }
     }
 }
-\f
+
 /* Read any terminal input already buffered up by the system
    into the kbd_buffer, but do not wait.
 
index 854ca61..5eaaeb4 100644 (file)
@@ -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: