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

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

[elpa] externals/transient 101c0aeaa1 023/366: transient--insert-suffix:


From: Jonas Bernoulli
Subject: [elpa] externals/transient 101c0aeaa1 023/366: transient--insert-suffix: Fix move of last child of a group
Date: Tue, 25 Jan 2022 18:54:23 -0500 (EST)

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

    transient--insert-suffix: Fix move of last child of a group
    
    When adding a suffix using `transient-{insert,append}-suffix' then
    an existing binding for the same command is removed, if any.  This
    is necessary to either *move* the suffix binding or to replace it
    with an alternative binding for the same command.  This can also
    happen when the same form gets evaluated twice, which can happen
    if it is autoloaded.
    
    When the suffix is the last child of a group, then this was broken.
    This is the same bug as was fixed with 0ad64ddc5db466fb3bcac67b931,
    but in a different function.
    
    Fixes #20.
---
 lisp/transient.el | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index ba1210ffe6..b3e7da6363 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -771,11 +771,7 @@ example, sets a variable use `define-infix-command' 
instead.
          (mem (transient--layout-member prefix loc)))
     (if mem
         (progn
-          (when-let ((old (transient--layout-member
-                           prefix (plist-get (nth 2 suf) :command))))
-            (setcar old (cadr old))
-            (setcdr old (cddr old))
-            (setq mem (transient--layout-member prefix loc)))
+          (transient-remove-suffix prefix (plist-get (nth 2 suf) :command))
           (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]