|
1 | 1 | (define-module (gloa)
|
| 2 | + #:use-module (gloa config) |
2 | 3 | #:use-module (gloa hello)
|
3 | 4 | #:use-module (system repl repl)
|
4 | 5 | #:declarative? #f
|
5 | 6 | #:export (gloa-main))
|
6 | 7 |
|
7 |
| -(define guile-user-config |
8 |
| - ;; The user's personal Guile REPL configuration. |
9 |
| - (and=> (getenv "HOME") |
10 |
| - (lambda (home) |
11 |
| - (string-append home "/.guile")))) |
12 |
| - |
13 | 8 | (define (set-user-module)
|
14 | 9 | (when (and ;; (not (assoc-ref opts 'ignore-dot-guile?)) ;; TODO: CLI flag for ignoring .guile
|
15 | 10 | guile-user-config
|
16 | 11 | (file-exists? guile-user-config))
|
17 | 12 | (load guile-user-config)))
|
18 | 13 |
|
19 |
| -(define (%default-db-location) |
20 |
| - "The default location of Gloa's tracking database." |
21 |
| - (string-append |
22 |
| - (or (getenv "XDG_CACHE_HOME") |
23 |
| - (format #f "~a/.cache" (getenv "HOME"))) |
24 |
| - "/gloa/gloa.sqlite")) |
25 |
| - |
26 |
| -(define (%default-storage-directory) |
27 |
| - "The default location of Gloa's tracked documents." |
28 |
| - (string-append |
29 |
| - (or (getenv "XDG_DATA_HOME") |
30 |
| - (format #f "~a/.local" (getenv "HOME"))) |
31 |
| - "/gloa/")) |
32 |
| - |
33 |
| -(define (%default-user-config-location) |
34 |
| - "Location of user's configuration of Gloa. |
35 |
| -Searches for @code{$XDG_CONFIG_HOME/gloa/init.scm} first, if that is not found, |
36 |
| -Gloa falls back to @code{$HOME/.gloa.d/init.scm}, and if that fails, |
37 |
| -@code{$HOME/.gloa.scm} is searched for. |
38 |
| -If none of those are found, no configuration changes to Gloa occur." |
39 |
| - (let ((config-dot-d (format #f "~a/.gloa.d" (getenv "HOME"))) |
40 |
| - (dot-config (format #f "~a/.gloa.scm" (getenv "HOME")))) |
41 |
| - (cond ((getenv "XDG_CONFIG_HOME") |
42 |
| - (string-append (getenv "XDG_CONFIG_HOME") "/gloa/init.scm")) |
43 |
| - ((and (file-exists? config-dot-d) (file-is-directory? config-dot-d)) |
44 |
| - (format #f "~a/init.scm" config-dot-d)) |
45 |
| - (#t dot-config)))) |
46 |
| - |
47 | 14 | (define* (gloa-main arg0 . args)
|
48 | 15 | ;; Add gloa site directory to Guile's load path so that user's can
|
49 | 16 | ;; easily import their own modules.
|
|
0 commit comments