aboutsummaryrefslogtreecommitdiff
path: root/config.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 /config.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 'config.scm')
-rw-r--r--config.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/config.scm b/config.scm
index 606384e9..8a24bc6a 100644
--- a/config.scm
+++ b/config.scm
@@ -7,7 +7,7 @@
(sxml xpath)
)
-(set-config! 'calendar-files (glob "~/.local/var/cal/*"))
+((@ (vcomponent config) calendar-files) (glob "~/.local/var/cal/*"))
(define my-courses
'((TSEA82 . "Datorteknik")
@@ -20,7 +20,7 @@
(define* (aref alist key optional: default)
(or (assoc-ref alist key) default key))
-(set-config! 'summary-filter
+((@ (calp html filter) summary-filter)
(lambda (ev str)
(regexp-substitute/global
#f "T[A-Z]{3}[0-9]{2}" str
@@ -83,7 +83,7 @@
"LiTHe kod"
"Klassfadder 2020"))
-(set-config! 'description-filter
+((@ (calp html filter) description-filter)
(lambda (ev str)
(cond [(member (prop (parent ev) 'NAME)
html-cals)
@@ -92,6 +92,6 @@
(parse-teams-description str)]
[else (parse-links str)])))
-(set-config! 'week-start mon)
-(set-config! 'default-calendar "Calendar")
-(set-config! 'path-prefix (car (glob "~/.local")))
+((@ (datetime) week-start) mon)
+((@ (vcomponent config) default-calendar) "Calendar")
+;; (set-config! 'path-prefix (car (glob "~/.local")))