[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 1c84d7adb1 6/8: Remap kp-subtract, kp-equal a
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 1c84d7adb1 6/8: Remap kp-subtract, kp-equal and kp-add |
Date: |
Wed, 11 May 2022 18:05:34 -0400 (EDT) |
branch: externals/transient
commit 1c84d7adb1cf104c83ace7d6a8b41ea7da2e79e2
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Remap kp-subtract, kp-equal and kp-add
Closes #185.
---
lisp/transient.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index d28eba6344..e09c4fe671 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1704,6 +1704,9 @@ of the corresponding object.")
(string-trim key)
cmd conflict)))
(define-key map kbd cmd))))
+ (when-let ((b (lookup-key map "-"))) (define-key map [kp-subtract] b))
+ (when-let ((b (lookup-key map "="))) (define-key map [kp-equal] b))
+ (when-let ((b (lookup-key map "+"))) (define-key map [kp-add] b))
(when transient-enable-popup-navigation
;; `transient--make-redisplay-map' maps only over bindings that are
;; directly in the base keymap, so that cannot be a composed keymap.
@@ -1772,7 +1775,10 @@ of the corresponding object.")
(define-key topmap (vconcat transient--redisplay-key (list key))
#'transient-update)))
(if transient--redisplay-key
- (lookup-key transient--transient-map (vconcat
transient--redisplay-key))
+ (let ((key (vconcat transient--redisplay-key)))
+ (or (lookup-key transient--transient-map key)
+ (and-let* ((regular (lookup-key local-function-key-map key)))
+ (lookup-key transient--transient-map (vconcat regular)))))
transient--transient-map))
topmap))
@@ -3442,7 +3448,12 @@ Optional support for popup buttons is also implemented
here."
(let ((len (length transient--redisplay-key))
(seq (cl-coerce (edmacro-parse-keys key t) 'list)))
(cond
- ((equal (seq-take seq len) transient--redisplay-key)
+ ((member (seq-take seq len)
+ (list transient--redisplay-key
+ (thread-last transient--redisplay-key
+ (cl-substitute ?- 'kp-subtract)
+ (cl-substitute ?= 'kp-equal)
+ (cl-substitute ?+ 'kp-add))))
(let ((pre (key-description (vconcat (seq-take seq len))))
(suf (key-description (vconcat (seq-drop seq len)))))
(setq pre (string-replace "RET" "C-m" pre))
- [elpa] externals/transient updated (84f2d12ef3 -> 6fc09a663e), Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient 7467a79c57 3/8: transient--suspend-override: Cancel display timer, Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient 5686a792f6 4/8: transient--suspend-override: Cancel prefix key display, Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient 09fdd454ff 2/8: transient-current-command: Fix docstring, Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient d9b3a54128 5/8: transient--delay-post-command: Handle execute-extended-command, Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient 6fc09a663e 8/8: make: Run check-declare-directory, Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient 8c62d0d223 1/8: Fix documentation typos, Jonas Bernoulli, 2022/05/11
- [elpa] externals/transient 1c84d7adb1 6/8: Remap kp-subtract, kp-equal and kp-add,
Jonas Bernoulli <=
- [elpa] externals/transient bd0e5e85ab 7/8: Improve function declarations, Jonas Bernoulli, 2022/05/11