]> code.delx.au - gnu-emacs/blobdiff - src/keyboard.c
(DECL_ALIGN, USE_LSB_TAG): Move logic to before definition of
[gnu-emacs] / src / keyboard.c
index 1fc666aa2ffa434621ca07b75675e196bafffdc0..0e9dfee877fa1f22b1eae007e0ef5f800955af31 100644 (file)
@@ -7,7 +7,7 @@ This file is part of GNU Emacs.
 
 GNU Emacs is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
 any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
@@ -108,8 +108,6 @@ int interrupt_input_pending;
 #define KBD_BUFFER_SIZE 4096
 #endif /* No X-windows */
 
-#define abs(x)         ((x) >= 0 ? (x) : -(x))
-
 /* Following definition copied from eval.c */
 
 struct backtrace
@@ -487,7 +485,7 @@ static struct input_event * volatile kbd_store_ptr;
 /* The above pair of variables forms a "queue empty" flag.  When we
    enqueue a non-hook event, we increment kbd_store_ptr.  When we
    dequeue a non-hook event, we increment kbd_fetch_ptr.  We say that
-   there is input available iff the two pointers are not equal.
+   there is input available if the two pointers are not equal.
 
    Why not just have a flag set and cleared by the enqueuing and
    dequeuing functions?  Such a flag could be screwed up by interrupts
@@ -1665,11 +1663,6 @@ command_loop_1 ()
            }
        }
 
-#ifdef C_ALLOCA
-      alloca (0);              /* Cause a garbage collection now */
-                               /* Since we can free the most stuff here.  */
-#endif /* C_ALLOCA */
-
 #if 0
       /* Select the frame that the last event came from.  Usually,
         switch-frame events will take care of this, but if some lisp
@@ -3703,7 +3696,7 @@ restore_getcjmp (temp)
    kbd_buffer_store_event places events in kbd_buffer, and
    kbd_buffer_get_event retrieves them.  */
 
-/* Return true iff there are any events in the queue that read-char
+/* Return true if there are any events in the queue that read-char
    would return.  If this returns false, a read-char would block.  */
 static int
 readable_events (flags)
@@ -4026,6 +4019,7 @@ discard_mouse_events ()
 
       if (sp->kind == MOUSE_CLICK_EVENT
          || sp->kind == WHEEL_EVENT
+          || sp->kind == HORIZ_WHEEL_EVENT
 #ifdef WINDOWSNT
          || sp->kind == W32_SCROLL_BAR_CLICK_EVENT
 #endif
@@ -5204,7 +5198,7 @@ Lisp_Object Vlispy_mouse_stem;
 
 static char *lispy_wheel_names[] =
 {
-  "wheel-up", "wheel-down"
+  "wheel-up", "wheel-down", "wheel-left", "wheel-right"
 };
 
 /* drag-n-drop events are generated when a set of selected files are
@@ -5841,6 +5835,7 @@ make_lispy_event (event)
       }
 
     case WHEEL_EVENT:
+    case HORIZ_WHEEL_EVENT:
       {
        Lisp_Object position;
        Lisp_Object head;
@@ -5925,6 +5920,9 @@ make_lispy_event (event)
               the up_modifier set.  */
            abort ();
 
+          if (event->kind == HORIZ_WHEEL_EVENT)
+            symbol_num += 2;
+
          /* Get the symbol we should use for the wheel event.  */
          head = modify_event_symbol (symbol_num,
                                      event->modifiers,
@@ -7093,7 +7091,7 @@ tty_read_avail_input (struct terminal *terminal,
   struct tty_display_info *tty = terminal->display_info.tty;
   int nread = 0;
 
-  if (terminal->deleted)        /* Don't read from a deleted terminal. */
+  if (!terminal->name)         /* Don't read from a dead terminal. */
     return;
 
   if (terminal->type != output_termcap)
@@ -7121,7 +7119,7 @@ tty_read_avail_input (struct terminal *terminal,
     return 0;                   /* The terminal is suspended. */
 
 #ifdef HAVE_GPM
-  if (term_gpm && gpm_tty == tty->terminal->id)
+  if (gpm_tty == tty)
   {
       Gpm_Event event;
       struct input_event hold_quit;
@@ -8096,10 +8094,11 @@ static Lisp_Object tool_bar_item_properties;
 
 static int ntool_bar_items;
 
-/* The symbols `tool-bar', and `:image'.  */
+/* The symbols `tool-bar', `:image' and `:rtl'.  */
 
 extern Lisp_Object Qtool_bar;
 Lisp_Object QCimage;
+Lisp_Object Qrtl;
 
 /* Function prototypes.  */
 
@@ -8385,6 +8384,9 @@ parse_tool_bar_item (key, item)
        /* Value is either a single image specification or a vector
           of 4 such specifications for the different button states.  */
        PROP (TOOL_BAR_ITEM_IMAGES) = value;
+      else if (EQ (key, Qrtl))
+        /* ':rtl STRING' */
+       PROP (TOOL_BAR_ITEM_RTL_IMAGE) = value;
     }
 
   /* If got a filter apply it on binding.  */
@@ -11315,7 +11317,8 @@ See also `current-input-mode'.  */)
   Fset_input_interrupt_mode (interrupt);
   Fset_output_flow_control (flow, Qnil);
   Fset_input_meta_mode (meta, Qnil);
-  Fset_quit_char (quit);
+  if (!NILP (quit))
+    Fset_quit_char (quit);
   return Qnil;
 }
 
@@ -11624,6 +11627,9 @@ syms_of_keyboard ()
   staticpro (&Qhelp_echo);
   Qhelp_echo = intern ("help-echo");
 
+  staticpro (&Qrtl);
+  Qrtl = intern (":rtl");
+
   staticpro (&item_properties);
   item_properties = Qnil;
 
@@ -11792,7 +11798,7 @@ syms_of_keyboard ()
   staticpro (&button_down_location);
   mouse_syms = Fmake_vector (make_number (1), Qnil);
   staticpro (&mouse_syms);
-  wheel_syms = Fmake_vector (make_number (2), Qnil);
+  wheel_syms = Fmake_vector (make_number (4), Qnil);
   staticpro (&wheel_syms);
 
   {