|
@@ -41,17 +41,16 @@ are in the plugins folder in coleslaw's source directory."
|
41
|
41
|
(apply 'enable-plugin (plugin-path name) args)))))
|
42
|
42
|
|
43
|
43
|
(defun discover-config-path (&optional (path ""))
|
44
|
|
- "Checks the project directory for a coleslawrc and if one
|
45
|
|
-doesn't exist, uses the coleslawrc in the home directory."
|
46
|
|
- (let ((rel-path (make-pathname :directory path :name ".coleslawrc")))
|
47
|
|
- (if (file-exists-p rel-path)
|
48
|
|
- rel-path
|
49
|
|
- (make-pathname :directory (namestring (user-homedir-pathname)) :name ".coleslawrc"))))
|
|
44
|
+ "Check the supplied PATH for a .coleslawrc and if one
|
|
45
|
+doesn't exist, use the .coleslawrc in the home directory."
|
|
46
|
+ (let ((custom-path (rel-path path ".coleslawrc")))
|
|
47
|
+ (if (file-exists-p custom-path)
|
|
48
|
+ custom-path
|
|
49
|
+ (rel-path (user-homedir-pathname) ".coleslawrc"))))
|
50
|
50
|
|
51
|
51
|
(defun load-config (config-key)
|
52
|
52
|
"Load the coleslaw configuration from DIR/.coleslawrc, using CONFIG-KEY
|
53
|
53
|
if necessary. DIR is ~ by default."
|
54
|
|
-
|
55
|
54
|
(with-open-file (in (discover-config-path config-key))
|
56
|
55
|
(let ((config-form (read in)))
|
57
|
56
|
(if (symbolp (car config-form))
|