[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/taxy 6bc628d 4/4: Add: (taxy-magit-section) :indent slo
From: |
ELPA Syncer |
Subject: |
[elpa] externals/taxy 6bc628d 4/4: Add: (taxy-magit-section) :indent slot |
Date: |
Sun, 29 Aug 2021 01:57:19 -0400 (EDT) |
branch: externals/taxy
commit 6bc628d02be76dc30a010daf16805b0dd80ff644
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Add: (taxy-magit-section) :indent slot
---
README.org | 1 +
taxy-magit-section.el | 9 +++++----
taxy.info | 15 +++++++++------
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/README.org b/README.org
index 7f232c8..fa77774 100644
--- a/README.org
+++ b/README.org
@@ -720,6 +720,7 @@ Note that =taxy-magit-section.el= is not installed with the
=taxy= package by de
*** Additions
+ Struct ~taxy~ now has a ~:make~ slot, a function called to make new
sub-taxys by ~take-take-keyed*~ (defaulting to ~make-taxy~). This is useful
when defining structs specialized on ~taxy~.
++ Struct ~taxy-magit-section~ now has an ~:indent~ slot, a number of
characters by which to indent each level of sub-taxy, applied automatically by
function ~taxy-magit-section-insert~.
*** Fixes
diff --git a/taxy-magit-section.el b/taxy-magit-section.el
index 1bbf81f..ff4f724 100644
--- a/taxy-magit-section.el
+++ b/taxy-magit-section.el
@@ -45,6 +45,7 @@
;; `taxy-magit-section-insert', but it allows a visibility function
;; to be specified to override the default for it.
(visibility-fn #'taxy-magit-section-visibility)
+ (indent 2)
format-fn)
;;;; Commands
@@ -59,10 +60,10 @@ descendant taxys; if `last', insert them after descendants."
(let* ((depth 0)
(magit-section-set-visibility-hook (cons
#'taxy-magit-section-visibility magit-section-set-visibility-hook)))
(cl-labels ((insert-object
- (object format-fn)
+ (object format-fn indent)
(magit-insert-section (magit-section object)
(magit-insert-section-body
- (insert (make-string (+ 2 (* depth
taxy-magit-section-indent)) ? )
+ (insert (make-string (+ 2 (* depth indent)) ? )
(funcall format-fn object)
"\n"))))
(insert-taxy
@@ -87,13 +88,13 @@ descendant taxys; if `last', insert them after descendants."
(magit-insert-section-body
(when (eq 'first objects)
(dolist (object (taxy-objects taxy))
- (insert-object object format-fn)))
+ (insert-object object format-fn
(taxy-magit-section-indent taxy))))
(cl-incf depth)
(mapc #'insert-taxy (taxy-taxys taxy))
(cl-decf depth)
(when (eq 'last objects)
(dolist (object (taxy-objects taxy))
- (insert-object object format-fn))))))))
+ (insert-object object format-fn
(taxy-magit-section-indent taxy)))))))))
(magit-insert-section (magit-section)
(insert-taxy taxy)))))
diff --git a/taxy.info b/taxy.info
index 9cb7c6c..e255d51 100644
--- a/taxy.info
+++ b/taxy.info
@@ -827,6 +827,9 @@ File: README.info, Node: Additions, Next: Fixes, Up:
02-pre
• Struct ‘taxy’ now has a ‘:make’ slot, a function called to make new
sub-taxys by ‘take-take-keyed*’ (defaulting to ‘make-taxy’). This
is useful when defining structs specialized on ‘taxy’.
+ • Struct ‘taxy-magit-section’ now has an ‘:indent’ slot, a number of
+ characters by which to indent each level of sub-taxy, applied
+ automatically by function ‘taxy-magit-section-insert’.
File: README.info, Node: Fixes, Prev: Additions, Up: 02-pre
@@ -909,12 +912,12 @@ Node: Magit section29589
Node: Changelog30190
Node: 02-pre30340
Node: Additions30462
-Node: Fixes30789
-Node: 0131039
-Node: Development31142
-Node: Copyright assignment31348
-Node: Credits31947
-Node: License32137
+Node: Fixes31002
+Node: 0131252
+Node: Development31355
+Node: Copyright assignment31561
+Node: Credits32160
+Node: License32350
End Tag Table