aboutsummaryrefslogtreecommitdiff
path: root/module/output/xcal.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/output/xcal.scm')
-rw-r--r--module/output/xcal.scm46
1 files changed, 22 insertions, 24 deletions
diff --git a/module/output/xcal.scm b/module/output/xcal.scm
index b4fee9b7..b2c3f899 100644
--- a/module/output/xcal.scm
+++ b/module/output/xcal.scm
@@ -101,30 +101,28 @@
(remove null?
`(,tagsymb
- ;; TODO only have <properties> when it's non-empty.
- ;; This becomes MUCH easier once properties stop returning
- ;; a hash-map...
- (properties
- ,@(filter
- identity
- (hash-map->list
- (match-lambda*
- [(? (compose internal-field? car)) #f]
-
- [(key (vlines ...))
- (remove null?
- `(,(downcase-symbol key)
- ,(parameters-tag (reduce assq-merge
- '() (map parameters vlines)))
- ,@(for vline in vlines
- (vline->value-tag vline))))]
-
- [(key vline)
- (remove null?
- `(,(downcase-symbol key)
- ,(parameters-tag (parameters vline))
- ,(vline->value-tag vline)))])
- (properties component))))
+ ;; only have <properties> when it's non-empty.
+ ,(let ((props
+ (filter-map
+ (match-lambda
+ [(? (compose internal-field? car)) #f]
+
+ [(key vlines ...)
+ (remove null?
+ `(,(downcase-symbol key)
+ ,(parameters-tag (reduce assq-merge
+ '() (map parameters vlines)))
+ ,@(for vline in vlines
+ (vline->value-tag vline))))]
+
+ [(key . vline)
+ (remove null?
+ `(,(downcase-symbol key)
+ ,(parameters-tag (parameters vline))
+ ,(vline->value-tag vline)))])
+ (properties component))))
+ (unless (null? props)
+ `(properties ,@props)))
,(unless (null? (children component))
`(components ,@(map vcomponent->sxcal (children component)))))))