transient-append-suffix to a conditional group #203
-
In magit I've added a shortcut to rebase on (defun magit-rebase-origin-main ()
(interactive)
(if (car (member "origin/main" (magit-list-remote-branch-names)))
(magit-git-rebase "origin/main" '())
(magit-git-rebase "origin/master" '())))
(transient-append-suffix 'magit-rebase "s"
'("a" "onto origin/main" magit-rebase-origin-main :if-not magit-rebase-in-progress-p)) Relevant excerpt from [1 transient-columns
(:description "Rebase" :if-not magit-rebase-in-progress-p)
([1 transient-column nil
((1 transient-suffix
(:key "i" :description "interactively" :command magit-rebase-interactive))
(1 transient-suffix
(:key "s" :description "a subset" :command magit-rebase-subset))
(1 transient-suffix
(:key "a" :description "onto origin/main" :command magit-rebase-origin-main :if-not magit-rebase-in-progress-p)))]
[1 transient-column nil
((1 transient-suffix
(:key "m" :description "to modify a commit" :command magit-rebase-edit-commit))
(1 transient-suffix
(:key "w" :description "to reword a commit" :command magit-rebase-reword-commit))
(1 transient-suffix
(:key "k" :description "to remove a commit" :command magit-rebase-remove-commit))
(1 transient-suffix
(:key "f" :description "to autosquash" :command magit-rebase-autosquash))
(6 transient-suffix
(:key "t" :description "to change dates" :command magit-reshelve-since)))])]
[1 transient-column
(:description "Actions" :if magit-rebase-in-progress-p)
((1 transient-suffix
(:key "r" :description "Continue" :command magit-rebase-continue))
(1 transient-suffix
(:key "s" :description "Skip" :command magit-rebase-skip))
(1 transient-suffix
(:key "e" :description "Edit" :command magit-rebase-edit)))]) Any ideas on what am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I have fixed the code responsible for removing a conflicting binding when adding a new binding. But this particular case still results in a false-positive and you have to use the new KEEP-OTHER argument to work around that. See a28a6c4, in particular the updated manual. |
Beta Was this translation helpful? Give feedback.
I have fixed the code responsible for removing a conflicting binding when adding a new binding. But this particular case still results in a false-positive and you have to use the new KEEP-OTHER argument to work around that.
See a28a6c4, in particular the updated manual.