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/calp/html/vcomponent.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 'module/calp/html/vcomponent.scm')
-rw-r--r-- | module/calp/html/vcomponent.scm | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/module/calp/html/vcomponent.scm b/module/calp/html/vcomponent.scm index 16189dff..91db44e6 100644 --- a/module/calp/html/vcomponent.scm +++ b/module/calp/html/vcomponent.scm @@ -25,22 +25,17 @@ :use-module ((base64) :select (base64encode)) :use-module (ice-9 format) :use-module (calp translation) + :use-module (calp html filter) ) -(define-config summary-filter (lambda (_ a) a) - pre: (ensure procedure?)) - -(define-config description-filter (lambda (_ a) a) - pre: (ensure procedure?)) - (define-public (format-summary ev str) - ((get-config 'summary-filter) ev str)) + ((summary-filter) ev str)) ;; NOTE this should have information about context (html/term/...) ;; And then be moved somewhere else. (define-public (format-description ev str) - (catch* (lambda () ((get-config 'description-filter) ev str)) + (catch* (lambda () ((description-filter) ev str)) (configuration-error (lambda (key subr msg args data) (format (current-error-port) @@ -396,7 +391,7 @@ (select (@ (class "calendar-selection")) ;; NOTE flytta "muffarna" utanför (option ,(_ "- Choose a Calendar -")) - ,@(let ((dflt (get-config 'default-calendar))) + ,@(let ((dflt ((@ (vcomponent) default-calendar)))) (map (lambda (calendar) (define name (prop calendar 'NAME)) `(option (@ (value ,(base64encode name)) |