diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-04-09 21:58:52 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-04-11 19:08:40 +0200 |
commit | f1532b4eca797f5aab4ec1a693a767a7a3e603c9 (patch) | |
tree | cd6f0fab78e36a67451aceac5e042e45d061e5f1 /module/vcomponent/config.scm | |
parent | Fix loop in import entry-point. (diff) | |
download | calp-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 '')
-rw-r--r-- | module/vcomponent/config.scm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/module/vcomponent/config.scm b/module/vcomponent/config.scm new file mode 100644 index 00000000..b2598207 --- /dev/null +++ b/module/vcomponent/config.scm @@ -0,0 +1,16 @@ +(define-module (vcomponent config) + :use-module (hnh util) + :use-module (calp translation) + :use-module (calp util config)) + +(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?)) + |