From 63f6581335d3d41dae4dc52ce37d593322a6ec19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 6 May 2019 23:27:31 +0200 Subject: Add glob routine. --- module/config.scm | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'module/config.scm') diff --git a/module/config.scm b/module/config.scm index d62b05db..e1000641 100644 --- a/module/config.scm +++ b/module/config.scm @@ -8,22 +8,10 @@ (srfi srfi-88) (ice-9 ftw) (ice-9 regex) - (ice-9 rdelim)) + (ice-9 rdelim) + (glob)) -(define (p str) - "Pathify string." - (regexp-substitute/global - #f "~[^/]*" str - 'pre (lambda (_) (getenv "HOME")) 'post)) - -(define (filename-hidden? str) - (char=? #\. (string-ref str 0))) - -(calendar-files - (let ((path #; "/mnt/arch/home/hugo/.calendars/" - (p "~/.calendars/"))) - (map (cut string-append path <>) - (scandir path (negate filename-hidden?))))) +(calendar-files (glob "~/.calendars/*")) ;;; TODO possibly replace with propper lookup (define my-courses -- cgit v1.2.3