]> code.delx.au - gnu-emacs/commitdiff
Fix 'this-command-keys' wrt prefix argument
authorEli Zaretskii <eliz@gnu.org>
Fri, 11 Dec 2015 09:53:53 +0000 (11:53 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 11 Dec 2015 09:53:53 +0000 (11:53 +0200)
* src/keyboard.c (command_loop_1): Restore the feature whereby C-u
was part of this-command-keys, but not of this-single-command-keys.
(Bug#22107)

* lisp/simple.el (internal-echo-keystrokes-prefix): Add
commentary about the function's return value.

lisp/simple.el
src/keyboard.c

index 17b9c918eadd6657e54673757f588ec5bcffad07..9e0388efe45e9ffc043c8c2d6f1f35a8a125bace 100644 (file)
@@ -3818,7 +3818,9 @@ see other processes running on the system, use `list-system-processes'."
 (setq prefix-command--last-echo nil)
 
 (defun internal-echo-keystrokes-prefix ()
-  ;; BEWARE: Called directly from the C code.
+  ;; BEWARE: Called directly from C code.
+  ;; If the return value is non-nil, it means we are in the middle of
+  ;; a command with prefix, such as a command invoked with prefix-arg.
   (if (not prefix-command--needs-update)
       prefix-command--last-echo
     (setq prefix-command--last-echo
index 02bc7d2a0b710dc48e05d24b35e63300223fb660..928d8496cdb11287636d8f88d7da0b5b0500f3f8 100644 (file)
@@ -1486,11 +1486,14 @@ command_loop_1 (void)
       if (!CONSP (last_command_event))
        kset_last_repeatable_command (current_kboard, Vreal_this_command);
 
-      this_command_key_count = 0;
-      this_single_command_key_start = 0;
-
-      if (current_kboard->immediate_echo
-         && !NILP (call0 (Qinternal_echo_keystrokes_prefix)))
+      /* Don't reset this_command_key_count if we've processed
+        prefix-arg.  */
+      if (NILP (call0 (Qinternal_echo_keystrokes_prefix)))
+       {
+         this_command_key_count = 0;
+         this_single_command_key_start = 0;
+       }
+      else if (current_kboard->immediate_echo)
        {
          current_kboard->immediate_echo = false;
          /* Refresh the echo message.  */