aboutsummaryrefslogtreecommitdiff
path: root/module/output/ical.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-05-22 23:39:21 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-05-23 12:59:19 +0200
commit60ade1ac7df55cd4034122cbdb20de70d91c1153 (patch)
treeb18810bb27073b70ffc804aa147d5abf927d294c /module/output/ical.scm
parentRemove export functions from terminal output. (diff)
downloadcalp-60ade1ac7df55cd4034122cbdb20de70d91c1153.tar.gz
calp-60ade1ac7df55cd4034122cbdb20de70d91c1153.tar.xz
Remove (vcomponent output) module.
Diffstat (limited to '')
-rw-r--r--module/output/ical.scm19
1 files changed, 10 insertions, 9 deletions
diff --git a/module/output/ical.scm b/module/output/ical.scm
index e289456b..1c9ce187 100644
--- a/module/output/ical.scm
+++ b/module/output/ical.scm
@@ -75,15 +75,16 @@
(handle-value (value vline))))
(define (escape-chars str)
- (with-output-to-string
- (lambda ()
- (string-for-each
- (lambda (ch)
- (case ch
- ((#\, #\; #\\) => (lambda (c) (display "\\") (display c)))
- ((#\newline) (display "\\n"))
- (else (display ch))))
- str))))
+ (define (escape char)
+ (string #\\ char))
+ (string-concatenate
+ (map (lambda (c)
+ (case c
+ ((#\newline) "\\n")
+ ((#\, #\; #\\) => escape)
+ (else => string)))
+ (string->list str))))
+
(define (generate-uuid)
((@ (rnrs io ports) call-with-port)