]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix corner case in prefix-arg handling for mouse events (Bug#1586).
authorChong Yidong <cyd@stupidchicken.com>
Sat, 2 Jul 2011 23:40:04 +0000 (19:40 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 2 Jul 2011 23:40:04 +0000 (19:40 -0400)
* src/keyboard.c (command_loop_1): If a down-mouse event is unbound,
leave any prefix arg for the up event.

src/ChangeLog
src/keyboard.c

index cb5d3bacba5982083094217e181b900ff556bca3..8b4029bd7b34520231754b9c1113a7a6837a3a7f 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
+
+       * keyboard.c (command_loop_1): If a down-mouse event is unbound,
+       leave any prefix arg for the up event (Bug#1586).
+
 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * lread.c (syms_of_lread): Mention single symbols defined by
index 3441f1dfd12d82825b995efb33705923bcf4ffcc..16300e6154c86db3583fba7c722ac12fd1ac58da 100644 (file)
@@ -1539,7 +1539,18 @@ command_loop_1 (void)
          message_with_string ("%s is undefined", keys, 0);
          KVAR (current_kboard, defining_kbd_macro) = Qnil;
          update_mode_lines = 1;
-         KVAR (current_kboard, Vprefix_arg) = Qnil;
+         /* If this is a down-mouse event, don't reset prefix-arg;
+            pass it to the command run by the up event.  */
+         if (EVENT_HAS_PARAMETERS (last_command_event))
+           {
+             Lisp_Object breakdown
+               = parse_modifiers (EVENT_HEAD (last_command_event));
+             int modifiers = XINT (XCAR (XCDR (breakdown)));
+             if (!(modifiers & down_modifier))
+               KVAR (current_kboard, Vprefix_arg) = Qnil;
+           }
+         else
+           KVAR (current_kboard, Vprefix_arg) = Qnil;
        }
       else
        {