Skip to content

Commit 5014429

Browse files
committed
Convert goto popup
1 parent 5c16937 commit 5014429

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

magit-stgit.el

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ one from the minibuffer, and move to the next line."
258258
[("i" "Init" magit-stgit-init)
259259
("f" "Float" magit-stgit-float)
260260
("s" "Sink" magit-stgit-sink)
261-
("a" "Goto" magit-stgit-goto-popup)]
261+
("a" "Goto" magit-stgit-goto)]
262262
[("c" "Commit" magit-stgit-commit)
263263
("C" "Uncommit" magit-stgit-uncommit)
264264
("r" "Repair" magit-stgit-repair)
@@ -537,21 +537,21 @@ ask for confirmation before deleting."
537537
patches ", "))))
538538
(magit-run-stgit-and-mark-remove patches "delete" args patches))))
539539

540-
(magit-define-popup magit-stgit-goto-popup
541-
"Popup console for StGit goto."
542-
'magit-stgit-commands
543-
:switches '((?k "Keep the local changes" "--keep")
544-
(?m "Check for patches merged upstream" "--merged"))
545-
:actions '((?a "Goto" magit-stgit-goto))
546-
:default-action #'magit-stgit-goto)
540+
(transient-define-prefix magit-stgit-goto ()
541+
"Make an arbitrary patch current."
542+
:man-page "stg-goto"
543+
["Arguments"
544+
("-k" "Keep the local changes" "--keep")
545+
("-m" "Check for patches merged upstream" "--merged")]
546+
["Actions"
547+
("a" "Goto" magit-stgit--goto)])
547548

548549
;;;###autoload
549-
(defun magit-stgit-goto (patch &rest args)
550-
"Set PATCH as target of StGit push and pop operations.
551-
Use ARGS to pass additional arguments."
552-
(interactive (list (magit-stgit-read-patches nil nil t t "Goto patch")
553-
(magit-stgit-goto-arguments)))
554-
(magit-run-stgit "goto" patch args))
550+
(defun magit-stgit--goto (patch &rest args)
551+
"Invoke `stg goto ARGS... PATCH'."
552+
(interactive (cons (car (magit-stgit-read-patches nil nil t t "Goto patch"))
553+
(transient-args 'magit-stgit-goto)))
554+
(magit-run-stgit "goto" args patch))
555555

556556
;;;###autoload
557557
(defun magit-stgit-show (patch)
@@ -727,7 +727,7 @@ the To, Cc, and Bcc fields for all patches."
727727
(defvar magit-stgit-patch-section-map
728728
(let ((map (make-sparse-keymap)))
729729
(define-key map "k" #'magit-stgit--delete)
730-
(define-key map "a" 'magit-stgit-goto)
730+
(define-key map "a" #'magit-stgit--goto)
731731
(define-key map (kbd "RET") #'magit-stgit-show)
732732
(define-key map "#" #'magit-stgit-mark-toggle)
733733
map))

0 commit comments

Comments
 (0)