aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2013-04-06 15:39:47 +0200
committerGravatar Tom Willemsen2013-04-06 15:39:47 +0200
commitce8cfd58f40f9f1808819d702bfb505e9f7d7e1d (patch)
tree60815f110762113527dea7be31f911d739b613b2
parent5ca43f20cad1e1f51713028aaf2cf9f55ce34eab (diff)
downloadclark-ce8cfd58f40f9f1808819d702bfb505e9f7d7e1d.tar.gz
clark-ce8cfd58f40f9f1808819d702bfb505e9f7d7e1d.zip
Fix usage without XDG_*_HOME
`concatenate' does not work as I thought, cannot handle list arguments, except `nil'.
-rw-r--r--lisp/clark.lisp24
1 files changed, 14 insertions, 10 deletions
diff --git a/lisp/clark.lisp b/lisp/clark.lisp
index 47b09d8..64f5fa4 100644
--- a/lisp/clark.lisp
+++ b/lisp/clark.lisp
@@ -107,19 +107,23 @@ The result contains the url, name and the description of the bookmark."
(defun get-db-location ()
"Get the location of the database."
- (pathname
- (apply 'concatenate 'string
- (or (sb-ext:posix-getenv "XDG_DATA_HOME")
- (list (sb-ext:posix-getenv "HOME") "/.local/share"))
- '("/clark/bookmarks.db"))))
+ (let ((xdg (sb-ext:posix-getenv "XDG_DATA_HOME"))
+ (home (sb-ext:posix-getenv "HOME")))
+ (pathname
+ (apply 'concatenate 'string
+ (or xdg home)
+ (unless xdg "/.local/share")
+ '("/clark/bookmarks.db")))))
(defun get-rc-location ()
"Get the location of the RC file."
- (pathname
- (apply 'concatenate 'string
- (or (sb-ext:posix-getenv "XDG_CONFIG_HOME")
- (list (sb-ext:posix-getenv "HOME") "/.config"))
- '("/clark/rc.lisp"))))
+ (let ((xdg (sb-ext:posix-getenv "XDG_CONFIG_HOME"))
+ (home (sb-ext:posix-getenv "HOME")))
+ (pathname
+ (apply 'concatenate 'string
+ (or xdg home)
+ (unless xdg "/.config")
+ '("/clark/rc.lisp")))))
(defun get-tag-id (name)
"Get the rowid of tag NAME."