aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-03-23 19:16:06 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2020-03-23 19:16:06 +0100
commited38cb9a4cddab81b72540fccf5c31d90a187834 (patch)
tree05f95d342cb09b1556db8d32815a648e0652a6b9
parentSlightly tweak text-backgrour-color relation. (diff)
downloadcalp-ed38cb9a4cddab81b72540fccf5c31d90a187834.tar.gz
calp-ed38cb9a4cddab81b72540fccf5c31d90a187834.tar.xz
Actually use X-WR-CALNAME.
-rw-r--r--module/vcomponent/parse.scm40
1 files changed, 20 insertions, 20 deletions
diff --git a/module/vcomponent/parse.scm b/module/vcomponent/parse.scm
index 11aa8dec..8efa9e62 100644
--- a/module/vcomponent/parse.scm
+++ b/module/vcomponent/parse.scm
@@ -308,7 +308,7 @@ row ~a column ~a ctx = ~a
(name
(catch 'system-error
(lambda () (call-with-input-file (/ path "displayname") read-line))
- (const (basename path "/")))))
+ (const #f))))
(reduce (lambda (item calendar)
@@ -369,25 +369,25 @@ row ~a column ~a ctx = ~a
(define-public (parse-cal-path path)
(define st (stat path))
(define cal
- (case (stat:type st)
- [(regular)
- (let ((comp (call-with-input-file path parse-calendar)))
- (set! (attr comp 'X-HNH-SOURCETYPE) "file")
- comp) ]
- [(directory)
- (report-time! "Parsing ~a" path)
- (let ((comp (parse-vdir path)))
- (set! (attr comp 'X-HNH-SOURCETYPE) "vdir")
- comp)]
- [(block-special char-special fifo socket unknown symlink)
- => (lambda (t) (error "Can't parse file of type " t))]))
-
- (unless (attr cal "NAME")
- (set! (attr cal "NAME")
- (or (attr cal "X-WR-CALNAME")
- "[NAMELESS]")))
-
- cal
+ (case (stat:type st)
+ [(regular)
+ (let ((comp (call-with-input-file path parse-calendar)))
+ (set! (attr comp 'X-HNH-SOURCETYPE) "file")
+ comp) ]
+ [(directory)
+ (report-time! "Parsing ~a" path)
+ (let ((comp (parse-vdir path)))
+ (set! (attr comp 'X-HNH-SOURCETYPE) "vdir")
+ comp)]
+ [(block-special char-special fifo socket unknown symlink)
+ => (lambda (t) (error "Can't parse file of type " t))]))
+
+ (unless (attr cal "NAME")
+ (set! (attr cal "NAME")
+ (or (attr cal "X-WR-CALNAME")
+ (string-append "[" (basename path) "]"))))
+
+ cal
)