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

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

[elpa] externals/transient 4ce1868e62 091/366: Fix replacing a suffix wi


From: Jonas Bernoulli
Subject: [elpa] externals/transient 4ce1868e62 091/366: Fix replacing a suffix with another suffix bound to same key
Date: Tue, 25 Jan 2022 18:54:30 -0500 (EST)

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

    Fix replacing a suffix with another suffix bound to same key
    
    This mainly concerns `transient-replace-suffix' but is done in a way
    that also works when `transient-insert-suffix' is abused to do so.
---
 lisp/transient.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 6f3e95606f..57be9ab7f3 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -871,8 +871,11 @@ example, sets a variable use `define-infix-command' 
instead.
   (let* ((suf (transient--parse-suffix prefix suffix))
          (mem (transient--layout-member loc prefix)))
     (if mem
-        (progn
-          (transient-remove-suffix prefix (plist-get (nth 2 suf) :key))
+        (let ((key (plist-get (nth 2 suf) :key)))
+          (if (equal (transient--kbd key)
+                     (transient--kbd (plist-get (nth 2 (car mem)) :key)))
+              (setq action 'replace)
+            (transient-remove-suffix prefix key))
           (cl-ecase action
             (insert  (setcdr mem (cons (car mem) (cdr mem)))
                      (setcar mem suf))



reply via email to

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