aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.scm2
-rw-r--r--module/calp/config-base.scm16
-rw-r--r--module/calp/main.scm22
3 files changed, 18 insertions, 22 deletions
diff --git a/config.scm b/config.scm
index 8a24bc6a..96d86006 100644
--- a/config.scm
+++ b/config.scm
@@ -2,7 +2,7 @@
;;; Currently loaded by main, and requires that `calendar-files`
;;; is set to a list of files (or directories).
-(use-modules (ice-9 regex)
+(use-modules (calp config-base)
(sxml simple)
(sxml xpath)
)
diff --git a/module/calp/config-base.scm b/module/calp/config-base.scm
new file mode 100644
index 00000000..cdd810de
--- /dev/null
+++ b/module/calp/config-base.scm
@@ -0,0 +1,16 @@
+;;; Commentary:
+;; Module intended to be included by user config, which exports some base
+;; bindings basically everyone should want.
+;;; Code:
+
+(define-module (calp config-base))
+
+(define cm (module-public-interface (current-module)))
+(for-each (lambda (name) (module-use! cm (resolve-interface name)))
+ `((ice-9 regex)
+ (srfi srfi-1)
+ (srfi srfi-88)
+ (datetime)
+ (vcomponent)
+ (glob)
+ ))
diff --git a/module/calp/main.scm b/module/calp/main.scm
index 9b3676dd..8efaf5ae 100644
--- a/module/calp/main.scm
+++ b/module/calp/main.scm
@@ -138,27 +138,7 @@ the same code as <b>ical</b>.</p>")
;; assumed to be "safe". Instead it's so we can control the environment in
;; which it is executed.
(catch #t
- (lambda ()
- (eval
- `(begin
- (use-modules (srfi srfi-1)
- (srfi srfi-88)
- (datetime)
- (vcomponent)
- (calp util config)
- (glob))
- ,@(with-input-from-file config-file
- (lambda ()
- (let loop ((done '()))
- (let ((form (read)))
- (if (eof-object? form)
- (reverse done)
- (loop (cons form done))))))))
- (make-sandbox-module
- `(((guile) use-modules resolve-interface module-ref)
- ,@all-pure-and-impure-bindings
- ))
- ))
+ (lambda () (load config-file))
(lambda args
(format (current-error-port)
;; Two arguments: