]> code.delx.au - gnu-emacs/blobdiff - src/keyboard.c
(isearch): Use magenta2 as bg for (background light)
[gnu-emacs] / src / keyboard.c
index 659a297b5a38abb1a72ef7a0de29cdbbb1c581e8..2aa4b51ccf3685000719d976ed64f5371aa4f92e 100644 (file)
@@ -2847,11 +2847,17 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
   if (CONSP (c) && EQ (XCAR (c), Qhelp_echo))
     {
       /* (help-echo FRAME HELP WINDOW OBJECT POS).  */
-      Lisp_Object help, object, position, window;
-      help = Fnth (make_number (2), c);
-      window = Fnth (make_number (3), c);
-      object = Fnth (make_number (4), c);
-      position = Fnth (make_number (5), c);
+      Lisp_Object help, object, position, window, tem;
+
+      tem = Fcdr (XCDR (c));
+      help = Fcar (tem);
+      tem = Fcdr (tem);
+      window = Fcar (tem);
+      tem = Fcdr (tem);
+      object = Fcar (tem);
+      tem = Fcdr (tem);
+      position = Fcar (tem);
+
       show_help_echo (help, window, object, position, 0);
 
       /* We stopped being idle for this event; undo that.  */
@@ -2983,7 +2989,7 @@ record_char (c)
     {
       Lisp_Object help;
 
-      help = Fnth (make_number (2), c);
+      help = Fcar (Fcdr (XCDR (c)));
       if (STRINGP (help))
        {
          int last_idx;
@@ -2996,7 +3002,7 @@ record_char (c)
          
          if (!CONSP (last_c)
              || !EQ (XCAR (last_c), Qhelp_echo)
-             || (last_help = Fnth (make_number (2), last_c),
+             || (last_help = Fcar (Fcdr (XCDR (last_c))),
                  !EQ (last_help, help)))
            {
              total_keys++;
@@ -4984,32 +4990,28 @@ make_lispy_event (event)
            else
 #endif
              {
-               /* The third element of every position should be the (x,y)
-                  pair.  */
                Lisp_Object down;
+               EMACS_INT xdiff = double_click_fuzz, ydiff = double_click_fuzz;
 
-               down = Fnth (make_number (2), start_pos);
-               if (EQ (event->x, XCAR (down)) && EQ (event->y, XCDR (down)))
-                 /* Mouse hasn't moved.  */
+               /* The third element of every position
+                  should be the (x,y) pair.  */
+               down = Fcar (Fcdr (Fcdr (start_pos)));
+               if (CONSP (down)
+                   && INTEGERP (XCAR (down)) && INTEGERP (XCDR (down)))
+                 {
+                   xdiff = XFASTINT (event->x) - XFASTINT (XCAR (down));
+                   ydiff = XFASTINT (event->y) - XFASTINT (XCDR (down));
+                 }
+
+               if (xdiff < double_click_fuzz && xdiff > - double_click_fuzz
+                   && ydiff < double_click_fuzz
+                   && ydiff > - double_click_fuzz)
+                 /* Mouse hasn't moved (much).  */
                  event->modifiers |= click_modifier;
                else
                  {
-                   Lisp_Object window1, window2, posn1, posn2;
-
-                   /* Avoid generating a drag event if the mouse
-                      hasn't actually moved off the buffer position.  */
-                   window1 = Fnth (make_number (0), position);
-                   posn1 = Fnth (make_number (1), position);
-                   window2 = Fnth (make_number (0), start_pos);
-                   posn2 = Fnth (make_number (1), start_pos);
-
-                   if (EQ (window1, window2) && EQ (posn1, posn2))
-                     event->modifiers |= click_modifier;
-                   else
-                     {
-                       button_down_time = 0;
-                       event->modifiers |= drag_modifier;
-                     }
+                   button_down_time = 0;
+                   event->modifiers |= drag_modifier;
                  }
                
                /* Don't check is_double; treat this as multiple
@@ -5444,7 +5446,7 @@ parse_modifiers_uncached (symbol, modifier_end)
   int i;
   int modifiers;
 
-  CHECK_SYMBOL (symbol, 1);
+  CHECK_SYMBOL (symbol);
 
   modifiers = 0;
   name = XSYMBOL (symbol)->name;
@@ -9035,7 +9037,7 @@ will read just one key sequence.  */)
   int count = specpdl_ptr - specpdl;
 
   if (!NILP (prompt))
-    CHECK_STRING (prompt, 0);
+    CHECK_STRING (prompt);
   QUIT;
 
   specbind (Qinput_method_exit_on_first_char,
@@ -9094,7 +9096,7 @@ DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,
   int count = specpdl_ptr - specpdl;
 
   if (!NILP (prompt))
-    CHECK_STRING (prompt, 0);
+    CHECK_STRING (prompt);
   QUIT;
 
   specbind (Qinput_method_exit_on_first_char,
@@ -9489,8 +9491,9 @@ requeued_events_pending_p ()
 
 
 DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 0, 0,
-       doc: /* T if command input is currently available with no waiting.
-Actually, the value is nil only if we can be sure that no input is available.  */)
+       doc: /* Return t if command input is currently available with no wait.
+Actually, the value is nil only if we can be sure that no input is available;
+if there is a doubt, the value is t.  */)
      ()
 {
   if (!NILP (Vunread_command_events) || unread_command_char != -1)
@@ -9676,7 +9679,7 @@ On such systems, Emacs starts a subshell instead of suspending.  */)
   struct gcpro gcpro1;
 
   if (!NILP (stuffstring))
-    CHECK_STRING (stuffstring, 0);
+    CHECK_STRING (stuffstring);
 
   /* Run the functions in suspend-hook.  */
   if (!NILP (Vrun_hooks))
@@ -10498,7 +10501,7 @@ this variable holds the actual mouse event that led to the menu,
 so that you can determine whether the command was run by mouse or not.  */);
 
   DEFVAR_LISP ("last-input-char", &last_input_char,
-              doc: /* Last input character.  */);
+              doc: /* Last input event.  */);
 
   DEFVAR_LISP_NOPRO ("last-input-event", &last_input_char,
                     doc: /* Last input event.  */);
@@ -10728,7 +10731,7 @@ This is measured in microseconds.  */);
   SET_SYMBOL_VALUE (Qecho_area_clear_hook, Qnil);
 
   DEFVAR_LISP ("lucid-menu-bar-dirty-flag", &Vlucid_menu_bar_dirty_flag,
-              doc: /* t means menu bar, specified Lucid style, needs to be recomputed.  */);
+              doc: /* Non-nil means menu bar, specified Lucid style, needs to be recomputed.  */);
   Vlucid_menu_bar_dirty_flag = Qnil;
 
   DEFVAR_LISP ("menu-bar-final-items", &Vmenu_bar_final_items,