emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/keycast 8530b7565f 5/6: keycast--unpdate: Handle undefined


From: ELPA Syncer
Subject: [nongnu] elpa/keycast 8530b7565f 5/6: keycast--unpdate: Handle undefined keys
Date: Tue, 16 Jan 2024 16:00:10 -0500 (EST)

branch: elpa/keycast
commit 8530b7565f4df30e3d00de8a40ac298cb0c38c70
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    keycast--unpdate: Handle undefined keys
---
 keycast.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/keycast.el b/keycast.el
index 5e20d8ac2f..8ceedc7cd0 100644
--- a/keycast.el
+++ b/keycast.el
@@ -378,6 +378,13 @@ t to show the actual COMMAND, or a symbol to be shown 
instead."
 (defun keycast--update ()
   (let ((key (this-single-command-keys))
         (cmd this-command))
+    ;; If a valid but incomplete prefix sequence is followed by
+    ;; an unbound key, then Emacs calls the `undefined' command
+    ;; but does not set `this-command', which is nil instead.
+    (when (and (not cmd)
+               (>= (length key) 1)
+               (eq (aref key (1- (length key))) ?\C-g))
+      (setq cmd 'undefined))
     (cond
      ;; Special handling for `execute-extended-command'.
      ((eq this-original-command 'execute-extended-command)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]