[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/magit 1c30bb1f9f 03/28: Use transient-scope
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/magit 1c30bb1f9f 03/28: Use transient-scope |
Date: |
Fri, 6 Dec 2024 17:17:02 -0500 (EST) |
branch: elpa/magit
commit 1c30bb1f9fb0668ec385fc3fb899b30d5507fad8
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Use transient-scope
---
lisp/magit-branch.el | 21 ++++++++-------------
lisp/magit-remote.el | 7 ++-----
2 files changed, 10 insertions(+), 18 deletions(-)
diff --git a/lisp/magit-branch.el b/lisp/magit-branch.el
index ad1ebea8ea..3ebda3fb94 100644
--- a/lisp/magit-branch.el
+++ b/lisp/magit-branch.el
@@ -208,14 +208,11 @@ has to be used to view and change branch related
variables."
(transient-define-prefix magit-branch (branch)
"Add, configure or remove a branch."
:man-page "git-branch"
- [:if (lambda ()
- (and magit-branch-direct-configure
- (oref (transient-prefix-object) scope)))
+ [:if (lambda () (and magit-branch-direct-configure (transient-scope)))
:description
(lambda ()
(concat (propertize "Configure " 'face 'transient-heading)
- (propertize (oref (transient-prefix-object) scope)
- 'face 'magit-branch-local)))
+ (propertize (transient-scope) 'face 'magit-branch-local)))
("d" magit-branch.<branch>.description)
("u" magit-branch.<branch>.merge/remote)
("r" magit-branch.<branch>.rebase)
@@ -859,8 +856,7 @@ and also rename the respective reflog file."
[:description
(lambda ()
(concat (propertize "Configure " 'face 'transient-heading)
- (propertize (oref (transient-prefix-object) scope)
- 'face 'magit-branch-local)))
+ (propertize (transient-scope) 'face 'magit-branch-local)))
("d" magit-branch.<branch>.description)
("u" magit-branch.<branch>.merge/remote)
("r" magit-branch.<branch>.rebase)
@@ -903,7 +899,7 @@ and also rename the respective reflog file."
:class 'magit--git-branch:upstream)
(cl-defmethod transient-init-value ((obj magit--git-branch:upstream))
- (when-let* ((branch (oref (transient-prefix-object) scope))
+ (when-let* ((branch (transient-scope))
(remote (magit-get "branch" branch "remote"))
(merge (magit-get "branch" branch "merge")))
(oset obj value (list remote merge))))
@@ -911,20 +907,19 @@ and also rename the respective reflog file."
(cl-defmethod transient-infix-read ((obj magit--git-branch:upstream))
(if (oref obj value)
(oset obj value nil)
- (magit-read-upstream-branch (oref (transient-prefix-object) scope)
- "Upstream")))
+ (magit-read-upstream-branch (transient-scope) "Upstream")))
(cl-defmethod transient-infix-set ((obj magit--git-branch:upstream) refname)
- (magit-set-upstream-branch (oref (transient-prefix-object) scope) refname)
+ (magit-set-upstream-branch (transient-scope) refname)
(oset obj value
- (and-let* ((branch (oref (transient-prefix-object) scope))
+ (and-let* ((branch (transient-scope))
(r (magit-get "branch" branch "remote"))
(m (magit-get "branch" branch "merge")))
(list r m)))
(magit-refresh))
(cl-defmethod transient-format ((obj magit--git-branch:upstream))
- (let ((branch (oref (transient-prefix-object) scope)))
+ (let ((branch (transient-scope)))
(format-spec
(oref obj format)
`((?k . ,(transient-format-key obj))
diff --git a/lisp/magit-remote.el b/lisp/magit-remote.el
index 2cf913cffd..3f9aa429ba 100644
--- a/lisp/magit-remote.el
+++ b/lisp/magit-remote.el
@@ -68,9 +68,7 @@ has to be used to view and change remote related variables."
:man-page "git-remote"
:value '("-f")
["Variables"
- :if (lambda ()
- (and magit-remote-direct-configure
- (oref (transient-prefix-object) scope)))
+ :if (lambda () (and magit-remote-direct-configure (transient-scope)))
("u" magit-remote.<remote>.url)
("U" magit-remote.<remote>.fetch)
("s" magit-remote.<remote>.pushurl)
@@ -315,8 +313,7 @@ refspec."
[:description
(lambda ()
(concat (propertize "Configure " 'face 'transient-heading)
- (propertize (oref (transient-prefix-object) scope)
- 'face 'magit-branch-remote)))
+ (propertize (transient-scope) 'face 'magit-branch-remote)))
("u" magit-remote.<remote>.url)
("U" magit-remote.<remote>.fetch)
("s" magit-remote.<remote>.pushurl)
- [nongnu] elpa/magit 089f130f73 11/28: ci: Generate statistics weekly, (continued)
- [nongnu] elpa/magit 089f130f73 11/28: ci: Generate statistics weekly, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit fed387282a 12/28: magit-submodule-populate: Support --recursive, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 3deaad3d29 16/28: Use mapcan instead of cl-mapcan, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit e8b85e43d4 23/28: magit-stash-push: Move "--" after other arguments, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 908de59440 26/28: Update changelog, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 961b966f9a 25/28: Require magit-process for the benefit of magit-auto-revert-mode, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 621b67fc7e 15/28: magit-list-special-refnames: Cosmetics, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 93a7752842 17/28: magit-bookmark-name: Cosmetics, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 1e17181a21 19/28: Regenerate texi manual, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 98667fa8b2 21/28: magit-stash-{pop, apply}: Copy edit documentation, Jonas Bernoulli, 2024/12/06
- [nongnu] elpa/magit 1c30bb1f9f 03/28: Use transient-scope,
Jonas Bernoulli <=
- [nongnu] elpa/magit 49c096722d 18/28: magit-insert-untracked-files: Improve docs, Jonas Bernoulli, 2024/12/06