[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 9c056d41a6 3/7: magit--git-variable:choices: Su
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 9c056d41a6 3/7: magit--git-variable:choices: Support changing global value |
Date: |
Tue, 1 Mar 2022 08:58:18 -0500 (EST) |
branch: elpa/git-commit
commit 9c056d41a658c84080d81244eef47915c51b9394
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit--git-variable:choices: Support changing global value
Instead of local value, not also.
---
lisp/magit-transient.el | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/lisp/magit-transient.el b/lisp/magit-transient.el
index 85fad022d6..3b9873a7e6 100644
--- a/lisp/magit-transient.el
+++ b/lisp/magit-transient.el
@@ -156,25 +156,30 @@
(cl-defmethod transient-format-value ((obj magit--git-variable:choices))
(let* ((variable (oref obj variable))
(choices (oref obj choices))
- (local (magit-git-string "config" "--local" variable))
+ (globalp (oref obj global))
+ (value nil)
(global (magit-git-string "config" "--global" variable))
(default (oref obj default))
(fallback (oref obj fallback))
(fallback (and fallback
(when-let ((val (magit-get fallback)))
(concat fallback ":" val)))))
+ (if (not globalp)
+ (setq value (magit-git-string "config" "--local" variable))
+ (setq value global)
+ (setq global nil))
(when (functionp choices)
(setq choices (funcall choices)))
(concat
(propertize "[" 'face 'transient-inactive-value)
(mapconcat (lambda (choice)
- (propertize choice 'face (if (equal choice local)
+ (propertize choice 'face (if (equal choice value)
(if (member choice choices)
'transient-value
'font-lock-warning-face)
'transient-inactive-value)))
- (if (and local (not (member local choices)))
- (cons local choices)
+ (if (and value (not (member value choices)))
+ (cons value choices)
choices)
(propertize "|" 'face 'transient-inactive-value))
(and (or global fallback default)
@@ -182,7 +187,7 @@
(propertize "|" 'face 'transient-inactive-value)
(cond (global
(propertize (concat "global:" global)
- 'face (cond (local
+ 'face (cond (value
'transient-inactive-value)
((member global choices)
'transient-value)
@@ -190,12 +195,12 @@
'font-lock-warning-face))))
(fallback
(propertize fallback
- 'face (if local
+ 'face (if value
'transient-inactive-value
'transient-value)))
(default
(propertize (concat "default:" default)
- 'face (if local
+ 'face (if value
'transient-inactive-value
'transient-value))))))
(propertize "]" 'face 'transient-inactive-value))))
- [nongnu] elpa/git-commit updated (0f96d39834 -> 0ab892a3b4), ELPA Syncer, 2022/03/01
- [nongnu] elpa/git-commit b5c0882a4f 2/7: magit-get-boolean: Support using scope argument, ELPA Syncer, 2022/03/01
- [nongnu] elpa/git-commit 064a047932 1/7: transient-infix-read: Use same macros as default around method, ELPA Syncer, 2022/03/01
- [nongnu] elpa/git-commit 72ee06c7ea 5/7: magit-read-unmerged-file: New function, ELPA Syncer, 2022/03/01
- [nongnu] elpa/git-commit 9c056d41a6 3/7: magit--git-variable:choices: Support changing global value,
ELPA Syncer <=
- [nongnu] elpa/git-commit a2ef67a415 4/7: magit--git-variable:boolean: New class, ELPA Syncer, 2022/03/01
- [nongnu] elpa/git-commit 630ada42cb 6/7: magit-extras.el: Rearrange a bit, ELPA Syncer, 2022/03/01
- [nongnu] elpa/git-commit 0ab892a3b4 7/7: magit-git-mergetool: New command, ELPA Syncer, 2022/03/01