aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-04-09 21:58:52 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-04-11 19:08:40 +0200
commitf1532b4eca797f5aab4ec1a693a767a7a3e603c9 (patch)
treecd6f0fab78e36a67451aceac5e042e45d061e5f1 /module/vcomponent.scm
parentFix loop in import entry-point. (diff)
downloadcalp-f1532b4eca797f5aab4ec1a693a767a7a3e603c9.tar.gz
calp-f1532b4eca797f5aab4ec1a693a767a7a3e603c9.tar.xz
Replace config system with paramater based system.
This new setup stores all configurations are parameters. This forces everything into modules, and ensures that we can't have a module use an unloaded config. It (unfortunatelly) also causes users to have to specify namespaces when defining values, but ini-files (and the like) already does that. Also, there is nothing stopping a new `set-config!' from being defined which allows un-namespaced operation. The commit also removes the introspection procedures. They where a bit weird to begin with, since they only showed loaded fields. And since the program had no way of properly serializing or deserializing them we remove them for the time being. They would however be good to reintroduce together with a proper menu for editing simple configuration (see Emacs' `custom-set-variables').
Diffstat (limited to 'module/vcomponent.scm')
-rw-r--r--module/vcomponent.scm19
1 files changed, 5 insertions, 14 deletions
diff --git a/module/vcomponent.scm b/module/vcomponent.scm
index 7618084c..0f000ba5 100644
--- a/module/vcomponent.scm
+++ b/module/vcomponent.scm
@@ -1,26 +1,17 @@
(define-module (vcomponent)
:use-module (hnh util)
- :use-module (calp util config)
:use-module (vcomponent base)
+ :use-module (vcomponent config)
;; :use-module ((vcomponent util instance methods)
;; :select (make-vcomponent))
:use-module ((vcomponent util parse-cal-path)
:select (parse-cal-path))
- :re-export (make-vcomponent parse-cal-path))
+ :re-export (make-vcomponent
+ parse-cal-path
+ ;; configuration items
+ calendar-files default-calendar))
(define cm (module-public-interface (current-module)))
(module-use! cm (resolve-interface '(vcomponent base)))
(module-use! cm (resolve-interface '(vcomponent util instance methods)))
-
-(define-config calendar-files '()
- description: "Which files to parse. Takes a list of paths or a single string which will be globbed."
- pre: (lambda (v)
- (cond [(list? v) v]
- [(string? v) ((@ (glob) glob) v)]
- [else #f])))
-
-(define-config default-calendar ""
- description: "Default calendar to use for operations. Set to empty string to unset"
- pre: (ensure string?))
-