aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/base.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/vcomponent/base.scm')
-rw-r--r--module/vcomponent/base.scm13
1 files changed, 7 insertions, 6 deletions
diff --git a/module/vcomponent/base.scm b/module/vcomponent/base.scm
index f43f532e..86ea40e8 100644
--- a/module/vcomponent/base.scm
+++ b/module/vcomponent/base.scm
@@ -16,11 +16,12 @@
(let ((parent (primitive-make-vcomponent)))
(for-each (lambda (child) (add-child! parent child))
(read-vcalendar path))
- (if (null? (get-component-children parent))
- (set-attribute! parent 'X-HNH-SOURCETYPE "vdir")
- (set-attribute! parent 'X-HNH-SOURCETYPE
- (get-attribute-value (car (get-component-children parent))
- 'X-HNH-SOURCETYPE "vdir")))
+ (set-attribute!
+ parent 'X-HNH-SOURCETYPE
+ (if (null? (get-component-children parent))
+ "vdir"
+ (get-attribute-value (car (get-component-children parent))
+ 'X-HNH-SOURCETYPE "vdir")))
parent))
;; vline → value
@@ -72,7 +73,7 @@
(define-public parent get-component-parent)
(define-public (attributes component)
- (hash-map->list cons (get-component-attributes component)))
+ (map car (hash-map->list cons (get-component-attributes component))))
(define*-public children get-component-children)