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

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

[elpa] externals/transient 3fe1b7ea86 086/366: transient--kbd: New funct


From: Jonas Bernoulli
Subject: [elpa] externals/transient 3fe1b7ea86 086/366: transient--kbd: New function
Date: Tue, 25 Jan 2022 18:54:29 -0500 (EST)

branch: externals/transient
commit 3fe1b7ea8600f96de46d0bc11e046bcc75ba838a
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    transient--kbd: New function
---
 lisp/transient.el | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index c44782f676..fe013f8ca6 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -941,13 +941,7 @@ PROP has to be a keyword.  What keywords and values
 (defun transient--layout-member (prefix loc &optional remove)
   (if-let ((layout (get prefix 'transient--layout)))
       (cl-labels
-          ((key (loc)
-                (when (vectorp loc)
-                  (setq loc (key-description loc)))
-                (when (stringp loc)
-                  (setq loc (kbd loc)))
-                loc)
-           (mem (layout loc)
+          ((mem (layout loc)
                 (cond
                  ((and (listp layout)
                        (vectorp (car layout)))
@@ -968,13 +962,21 @@ PROP has to be a keyword.  What keywords and values
                               (cmd (plist-get def :command)))
                          (if (symbolp loc)
                              (eq cmd loc)
-                           (equal (key (or (plist-get def :key)
-                                           (transient--command-key cmd)))
+                           (equal (transient--kbd
+                                   (or (plist-get def :key)
+                                       (transient--command-key cmd)))
                                   loc))))
                   layout))))
-        (mem layout (key loc)))
+        (mem layout (transient--kbd loc)))
     (error "%s is not a transient command" prefix)))
 
+(defun transient--kbd (keys)
+  (when (vectorp keys)
+    (setq keys (key-description keys)))
+  (when (stringp keys)
+    (setq keys (kbd keys)))
+  keys)
+
 (defun transient--command-key (cmd)
   (when-let ((obj (get cmd 'transient--suffix)))
     (cond ((slot-boundp obj 'key)



reply via email to

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