Skip to content

Commit f3b26f1

Browse files
committed
check for custom theme path existence first
1 parent 668577e commit f3b26f1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ This path then needs to be loaded within your emacs config:
5050
Alternatively, this snippet discovers all theme directories in `~/.emacs.d/themes/`:
5151

5252
```elisp
53-
(let ((basedir "~/.emacs.d/themes/"))
54-
(dolist (f (directory-files basedir))
55-
(if (and (not (or (equal f ".") (equal f "..")))
56-
(file-directory-p (concat basedir f)))
57-
(add-to-list 'custom-theme-load-path (concat basedir f)))))
53+
(let ((basedir (locate-user-emacs-file "themes/")))
54+
(when (file-directory-p basedir)
55+
(dolist (f (directory-files basedir))
56+
(if (and (not (or (equal f ".") (equal f "..")))
57+
(file-directory-p (concat basedir f)))
58+
(add-to-list 'custom-theme-load-path (concat basedir f))))))
5859
```
5960

6061
To load the theme, call `load-theme` interactively:

0 commit comments

Comments
 (0)