[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit fd2feb4a48 2/3: magit-push-to-remote: Define us
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit fd2feb4a48 2/3: magit-push-to-remote: Define using transient-define-suffix |
Date: |
Sat, 25 Jun 2022 08:58:22 -0400 (EDT) |
branch: elpa/git-commit
commit fd2feb4a48f56773ea1958f71be22a8b8c6c52c4
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-push-to-remote: Define using transient-define-suffix
This allows specifying the description function up front.
---
lisp/magit-push.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/lisp/magit-push.el b/lisp/magit-push.el
index f80982dfa1..03f44d7ffb 100644
--- a/lisp/magit-push.el
+++ b/lisp/magit-push.el
@@ -320,8 +320,8 @@ what this command will do. To add it use something like:
(magit--propertize-face "push.default" 'bold)
(magit--propertize-face default 'bold)))))
-;;;###autoload
-(defun magit-push-to-remote (remote args)
+;;;###autoload (autoload 'magit-push-to-remote "magit-push" nil t)
+(transient-define-suffix magit-push-to-remote (remote args)
"Push to REMOTE without using an explicit refspec.
The REMOTE is read in the minibuffer.
@@ -330,7 +330,13 @@ are the arguments specified in the popup buffer. No
refspec
arguments are used. Instead the behavior depends on at least
these Git variables: `push.default', `remote.pushDefault',
`branch.<branch>.pushRemote', `branch.<branch>.remote',
-`branch.<branch>.merge', and `remote.<remote>.push'."
+`branch.<branch>.merge', and `remote.<remote>.push'.
+
+You can add this command as a suffix using something like:
+
+ (transient-insert-suffix \\='magit-push \"o\"
+ \\='(\"x\" magit-push-to-remote))"
+ :description #'magit-push-to-remote--desc
(interactive (list (magit-read-remote "Push to remote")
(magit-push-arguments)))
(run-hooks 'magit-credential-hook)