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

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

[elpa] externals/transient ed992c58cd 094/366: Properly handle existing


From: Jonas Bernoulli
Subject: [elpa] externals/transient ed992c58cd 094/366: Properly handle existing string pseudo suffixes
Date: Tue, 25 Jan 2022 18:54:30 -0500 (EST)

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

    Properly handle existing string pseudo suffixes
    
    ... when manipulating existing real suffixes.
    
    Closes #47.
---
 lisp/transient.el | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 46b05443e9..b107b97632 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -877,13 +877,15 @@ example, sets a variable use `define-infix-command' 
instead.
      ((not mem)
       (message "Cannot insert %S into %s; %s not found"
                suffix prefix loc))
-     ((not (eq (type-of suffix)
-               (type-of elt)))
+     ((or (and (vectorp suffix) (not (vectorp elt)))
+          (and (listp   suffix) (vectorp elt))
+          )
       (message "Cannot place %S into %s at %s; %s"
                suffix prefix loc
                "suffixes and groups cannot be siblings"))
      (t
-      (when (listp suffix)
+      (when (and (listp suffix)
+                 (listp elt))
         (let ((key (plist-get (nth 2 suf) :key)))
           (if (equal (transient--kbd key)
                      (transient--kbd (plist-get (nth 2 elt) :key)))
@@ -998,14 +1000,15 @@ See info node `(transient)Modifying Existing 
Transients'."
 
 (defun transient--group-member (loc group)
   (cl-member-if (lambda (suffix)
-                  (let* ((def (nth 2 suffix))
-                         (cmd (plist-get def :command)))
-                    (if (symbolp loc)
-                        (eq cmd loc)
-                      (equal (transient--kbd
-                              (or (plist-get def :key)
-                                  (transient--command-key cmd)))
-                             loc))))
+                  (and (listp suffix)
+                       (let* ((def (nth 2 suffix))
+                              (cmd (plist-get def :command)))
+                         (if (symbolp loc)
+                             (eq cmd loc)
+                           (equal (transient--kbd
+                                   (or (plist-get def :key)
+                                       (transient--command-key cmd)))
+                                  loc)))))
                 (aref group 3)))
 
 (defun transient--kbd (keys)



reply via email to

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