aboutsummaryrefslogtreecommitdiff
path: root/module/main.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-11-03 14:46:28 +0100
committerHugo Hörnquist <hugo@hornquist.se>2019-11-03 14:46:28 +0100
commit0f65e75ec0f56d3067a15e3671d9250fd2c1637a (patch)
tree40ddc24f08b42c767e02b6482133e9f7efe4b524 /module/main.scm
parentRemove 'none' output. (diff)
parentAdd descirption to strbuf. (diff)
downloadcalp-0f65e75ec0f56d3067a15e3671d9250fd2c1637a.tar.gz
calp-0f65e75ec0f56d3067a15e3671d9250fd2c1637a.tar.xz
Merge branch 'restruct'
Diffstat (limited to 'module/main.scm')
-rwxr-xr-xmodule/main.scm19
1 files changed, 9 insertions, 10 deletions
diff --git a/module/main.scm b/module/main.scm
index 29c7317a..242883ea 100755
--- a/module/main.scm
+++ b/module/main.scm
@@ -1,14 +1,7 @@
#!/bin/bash
# -*- mode: scheme -*-
-root=$(dirname $(dirname $(realpath $0)))
-
-GUILE_LOAD_PATH="$root/module:$GUILE_LOAD_PATH"
-GUILE_LOAD_COMPILED_PATH="$root/obj/module:$GUILE_LOAD_COMPILED_PATH"
-LD_LIBRARY_PATH="$root/lib:$LD_LIBRARY_PATH"
-
-export GUILE_LOAD_PATH GUILE_LOAD_COMPILED_PATH LD_LIBRARY_PATH
-export GUILE_AUTO_COMPILE=0
+. $(dirname $(dirname $(realpath $0)))/env
exec guile -e main -s $0 "$@"
!#
@@ -29,6 +22,7 @@ exec guile -e main -s $0 "$@"
(output text)
(output import)
(output info)
+ (output ical)
(server)
(ice-9 getopt-long)
@@ -44,8 +38,12 @@ exec guile -e main -s $0 "$@"
;;
;; Given as a sepparate function from main to ease debugging.
(define* (init proc #:key (calendar-files (calendar-files)))
- (define calendars (map make-vcomponent calendar-files))
- (define events (concatenate (map (cut children <> 'VEVENT) calendars)))
+ (define calendars (map parse-calendar calendar-files))
+ (define events (concatenate
+ ;; TODO does this drop events?
+ (map (lambda (cal) (filter (lambda (o) (eq? 'VEVENT (type o)))
+ (children cal)))
+ calendars)))
(let* ((repeating regular (partition repeating? events)))
@@ -96,6 +94,7 @@ exec guile -e main -s $0 "$@"
((term) terminal-main)
((import) import-main)
((info) info-main)
+ ((ical) ical-main)
((server) server-main))
c e ropt)))
calendar-files: (or (and=> (option-ref opts 'file #f)