aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-04-25 11:39:38 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-04-25 11:39:49 +0200
commit2d78e18454545801fbf3ac02c1d32ea68ef65de2 (patch)
tree96cd2d971f0369b4af2eef0c5dab475624b7c30f /module/vcomponent
parentRemove take-drop-while, span already in SRFI-1. (diff)
downloadcalp-2d78e18454545801fbf3ac02c1d32ea68ef65de2.tar.gz
calp-2d78e18454545801fbf3ac02c1d32ea68ef65de2.tar.xz
Clean up util and move exceptions.
Diffstat (limited to '')
-rw-r--r--module/vcomponent/output.scm58
-rw-r--r--module/vcomponent/recurrence/parse.scm2
2 files changed, 29 insertions, 31 deletions
diff --git a/module/vcomponent/output.scm b/module/vcomponent/output.scm
index 8db2d85b..6d346230 100644
--- a/module/vcomponent/output.scm
+++ b/module/vcomponent/output.scm
@@ -27,16 +27,15 @@
(format port "~a <~a> :: ~:a~%"
(make-string depth #\:)
(type comp) comp)
- (for-each-in kvs
- (lambda (kv)
- (let* (((key . at) kv))
- (format port "~a ~15@a~{;~a=~{~a~^,~}~}: ~a~%"
- (make-string depth #\:)
- key
- (concatenate (hash-map->list list (cdr at)))
- (v at)))))
- (for-each-in (children comp)
- (lambda (e) (print-vcomponent e port #:depth (1+ depth))))))
+ (for kv in kvs
+ (let* (((key . at) kv))
+ (format port "~a ~15@a~{;~a=~{~a~^,~}~}: ~a~%"
+ (make-string depth #\:)
+ key
+ (concatenate (hash-map->list list (cdr at)))
+ (v at))))
+ (for-each (lambda (e) (print-vcomponent e port #:depth (1+ depth)))
+ (children comp))))
@@ -69,29 +68,28 @@ Removes the X-HNH-FILENAME attribute, and sets PRODID to
(let ((kvs (map (lambda (key) (list key (attr comp key)))
(filter (negate (cut key=? <> 'X-HNH-FILENAME))
(attributes comp)))))
- (for-each-in
- kvs (lambda (kv)
- (let* (((key value) kv))
- (catch 'wrong-type-arg
- (lambda ()
- (format port "~a:~a~%" key
- (string->ics-safe-string
- (or (case key
- ((DTSTART DTEND)
- (if (string? value)
- value
- (time->string value "~Y~m~dT~H~M~S")))
+ (for kv in kvs
+ (let* (((key value) kv))
+ (catch 'wrong-type-arg
+ (lambda ()
+ (format port "~a:~a~%" key
+ (string->ics-safe-string
+ (or (case key
+ ((DTSTART DTEND)
+ (if (string? value)
+ value
+ (time->string value "~Y~m~dT~H~M~S")))
- ((DURATION) "Just forget it")
+ ((DURATION) "Just forget it")
- (else value))
- ""))))
+ (else value))
+ ""))))
- ;; Catch
- (lambda (type proc fmt . args)
- (apply format (current-error-port) "[ERR] ~a in ~a (~a) ~a:~%~?~%"
- type key proc (attr comp 'X-HNH-FILENAME)
- fmt args))))))
+ ;; Catch
+ (lambda (type proc fmt . args)
+ (apply format (current-error-port) "[ERR] ~a in ~a (~a) ~a:~%~?~%"
+ type key proc (attr comp 'X-HNH-FILENAME)
+ fmt args)))))
(for-each (cut serialize-vcomponent <> port) (children comp)))
(format port "END:~a~%" (type comp))))
diff --git a/module/vcomponent/recurrence/parse.scm b/module/vcomponent/recurrence/parse.scm
index 0b62d134..15e03f9c 100644
--- a/module/vcomponent/recurrence/parse.scm
+++ b/module/vcomponent/recurrence/parse.scm
@@ -7,7 +7,7 @@
#:duplicates (last) ; Replace @var{count}
#:use-module (vcomponent recurrence internal)
#:use-module (util)
- #:use-module (exceptions)
+ #:use-module (util exceptions)
#:use-module (ice-9 curried-definitions)
#:export (parse-recurrence-rule))