aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-06 01:07:31 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-07 13:10:38 +0200
commit715099dcc31bd35fc72bd9d337ff9ad3c0581247 (patch)
treee323ea38b4eb82e0081313a305251a05dbf23237
parentIntroduce HTML edit mode. (diff)
downloadcalp-715099dcc31bd35fc72bd9d337ff9ad3c0581247.tar.gz
calp-715099dcc31bd35fc72bd9d337ff9ad3c0581247.tar.xz
Extend (vcomponent describe) to handle multi-valued fields.
-rw-r--r--module/vcomponent/describe.scm28
1 files changed, 16 insertions, 12 deletions
diff --git a/module/vcomponent/describe.scm b/module/vcomponent/describe.scm
index a16c67d0..f6c77f55 100644
--- a/module/vcomponent/describe.scm
+++ b/module/vcomponent/describe.scm
@@ -13,18 +13,22 @@
(format #t "~aBEGIN ~a~%" ii (type vcomponent))
- (hash-for-each (lambda (key vline)
- (format #t "~a~a = ~a"
- iii
- (trim-to-width (symbol->string key) maxlen)
- (trim-to-width
- (format #f "~a" (value vline))
- (- 80 indent maxlen)))
- (awhen (parameters vline)
- (display " ;")
- (for (key value) in it
- (format #t " ~a=~a" key value)))
- (newline))
+ (hash-for-each (lambda (key values)
+ (define (out vline)
+ (format #t "~a~a = ~a"
+ iii
+ (trim-to-width (symbol->string key) maxlen)
+ (trim-to-width
+ (format #f "~a" (value vline))
+ (- 80 indent maxlen)))
+ (awhen (parameters vline)
+ (display " ;")
+ (for (key value) in it
+ (format #t " ~a=~a" key value)))
+ (newline))
+ (if (list? values)
+ (for-each out values)
+ (out values)))
(properties vcomponent))
(for child in (children vcomponent)