aboutsummaryrefslogtreecommitdiff
path: root/module/config.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-05-06 23:27:31 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-05-06 23:27:31 +0200
commit63f6581335d3d41dae4dc52ce37d593322a6ec19 (patch)
tree10641b5fd156d80d7f5061704e9e194de84f2af3 /module/config.scm
parentAdd value function. (diff)
downloadcalp-63f6581335d3d41dae4dc52ce37d593322a6ec19.tar.gz
calp-63f6581335d3d41dae4dc52ce37d593322a6ec19.tar.xz
Add glob routine.
Diffstat (limited to '')
-rw-r--r--module/config.scm18
1 files changed, 3 insertions, 15 deletions
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