From bba0ac5316239f121e0413325c03090df7a97f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 9 May 2020 05:17:02 +0200 Subject: Set X-HNH-FILENAME outside parse-calendar. --- module/vcomponent/parse.scm | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'module/vcomponent/parse.scm') 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) -- cgit v1.2.3