branch: elpa/magit
commit c58fc97c0ae53647148a3b490765d0a02fcb00ce
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-section-visibility-indicator: Optimize display of custom values
For constant choices, we would like to display just the "tag" because
displaying the value would be redundant. For composed types we cannot
just drop "%v" from the format. The child values have to represent
by some widget/text in the buffer, because the widget library expects
that, even if the values of the child widgets are constant. So insert
" " for each cons cell slot.
---
lisp/magit-section.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 21e6cad9097..f75e013c9d0 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -229,14 +229,17 @@ Otherwise the value has to have one of these three forms:
:group 'magit-section
:type '(choice (const :tag "No indicators" nil)
(cons :tag "Use +- fringe indicators"
- (const magit-fringe-bitmap+)
- (const magit-fringe-bitmap-))
+ :format "%{%t%}%v\n"
+ (const :format " " magit-fringe-bitmap+)
+ (const :format " " magit-fringe-bitmap-))
(cons :tag "Use >v fringe indicators"
- (const magit-fringe-bitmap>)
- (const magit-fringe-bitmapv))
+ :format "%{%t%}%v\n"
+ (const :format " " magit-fringe-bitmap>)
+ (const :format " " magit-fringe-bitmapv))
(cons :tag "Use bold >v fringe indicators"
- (const magit-fringe-bitmap-bold>)
- (const magit-fringe-bitmap-boldv))
+ :format "%{%t%}%v\n"
+ (const :format " " magit-fringe-bitmap-bold>)
+ (const :format " " magit-fringe-bitmap-boldv))
(cons :tag "Use custom fringe indicators"
(variable :tag "Expandable bitmap variable")
(variable :tag "Collapsible bitmap variable"))