From 35a413167e323f8b0c9ea40fe7599ffb50e9e321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 31 Mar 2020 16:46:02 +0200 Subject: Attempt at decentralized configuration system. Placing all possible configuration items in a central (parameters) module scales really badly. This idea that any module can register configuration parameters is better. The current implementation however has the drawback that it requires that the module exposing the parameter is loaded before the value can be sat, but that scales even worse. A probable solution would be to abandon binding everything to guile's module system, and instead let (util config) provide a `conf-ref' and a `conf-set!' procedures. A `define-configuration' similar to emacs `defcustom' could be of use, mainly for retroactively type checking parameters. --- module/output/html.scm | 12 +++++++++++- module/output/terminal.scm | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'module/output') diff --git a/module/output/html.scm b/module/output/html.scm index 8c7d9674..299dde3d 100644 --- a/module/output/html.scm +++ b/module/output/html.scm @@ -7,6 +7,7 @@ #:use-module (vcomponent group) #:use-module (vcomponent datetime) #:use-module (util) + #:use-module (util config) #:use-module (util tree) #:duplicates (last) #:use-module (datetime) @@ -17,9 +18,18 @@ #:use-module (git) - #:use-module (parameters) + ;; #:use-module (module config all) ) +(register-config! + summary-filter + (lambda (_ a) a) + (ensure procedure?)) + +(register-config! + description-filter + (lambda (_ a) a) + (ensure procedure?)) (define (date-link date) (date->string date "~Y-~m-~d")) diff --git a/module/output/terminal.scm b/module/output/terminal.scm index cb18649d..c344776f 100644 --- a/module/output/terminal.scm +++ b/module/output/terminal.scm @@ -19,7 +19,7 @@ #:use-module (vcomponent datetime) #:use-module (ice-9 format) - #:use-module (parameters) + ;; #:use-module (parameters) #:export (main-loop)) -- cgit v1.2.3