aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/parse.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-05-09 05:17:02 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-05-09 05:17:02 +0200
commitbba0ac5316239f121e0413325c03090df7a97f2e (patch)
tree0350897c3a3dabe3fc0226a7428d916e18d18912 /module/vcomponent/parse.scm
parentAdd draft of new parser. (diff)
downloadcalp-bba0ac5316239f121e0413325c03090df7a97f2e.tar.gz
calp-bba0ac5316239f121e0413325c03090df7a97f2e.tar.xz
Set X-HNH-FILENAME outside parse-calendar.
Diffstat (limited to 'module/vcomponent/parse.scm')
-rw-r--r--module/vcomponent/parse.scm23
1 files changed, 13 insertions, 10 deletions
diff --git a/module/vcomponent/parse.scm b/module/vcomponent/parse.scm
index 94eaaef2..b2332042 100644
--- a/module/vcomponent/parse.scm
+++ b/module/vcomponent/parse.scm
@@ -11,7 +11,7 @@
:use-module (util exceptions)
:use-module (vcomponent base)
- :use-module (vcomponent parse old)
+ :use-module (vcomponent parse new)
:re-export (parse-calendar)
)
@@ -39,6 +39,7 @@
(define-values (events other) (partition (lambda (e) (eq? 'VEVENT (type e)))
(children item)))
+
;; (assert (eq? 'VCALENDAR (type calendar)))
(assert (eq? 'VCALENDAR (type item)))
@@ -88,15 +89,17 @@
;; return
calendar)
(make-vcomponent)
- ((@ (ice-9 threads) par-map) (lambda (fname)
- (let ((fullname (/ path fname)))
- (let ((cal (call-with-input-file fullname
- parse-calendar)))
- (set! (attr cal 'COLOR) color
- (attr cal 'NAME) name)
- cal)))
- (scandir path (lambda (s) (and (not (string= "." (string-take s 1)))
- (string= "ics" (string-take-right s 3))))))))))
+ (map #; (@ (ice-9 threads) par-map)
+ (lambda (fname)
+ (let ((fullname (/ path fname)))
+ (let ((cal (call-with-input-file fullname
+ parse-calendar)))
+ (set! (attr cal 'COLOR) color
+ (attr cal 'NAME) name
+ (attr cal 'X-HNH-FILENAME) fullname)
+ cal)))
+ (scandir path (lambda (s) (and (not (string= "." (string-take s 1)))
+ (string= "ics" (string-take-right s 3))))))))))
;; Parse a vdir or ics file at the given path.
(define-public (parse-cal-path path)