[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 9d2b8e7: Fix 'this-command-keys' wrt prefix argum
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-25 9d2b8e7: Fix 'this-command-keys' wrt prefix argument |
Date: |
Fri, 11 Dec 2015 09:54:45 +0000 |
branch: emacs-25
commit 9d2b8e768f2015a89f7609dedf7b28ea5e8123b5
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Fix 'this-command-keys' wrt prefix argument
* 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 | 4 +++-
src/keyboard.c | 13 ++++++++-----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index 17b9c91..9e0388e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -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
diff --git a/src/keyboard.c b/src/keyboard.c
index 02bc7d2..928d849 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -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. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 9d2b8e7: Fix 'this-command-keys' wrt prefix argument,
Eli Zaretskii <=