diff --git a/lisp/custom.el b/lisp/custom.el index b3311a1783..d21e398646 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -1292,6 +1292,7 @@ custom-available-themes (let ((suffix "-theme\\.el\\'") themes) (dolist (dir (custom-theme--load-path)) + ;; `custom-theme--load-path' promises DIR exists. (dolist (file (directory-files dir nil suffix)) (let ((theme (intern (substring file 0 (string-match-p suffix file))))) (and (custom-theme-name-valid-p theme) @@ -1300,6 +1301,8 @@ custom-available-themes (nreverse themes))) (defun custom-theme--load-path () + "Expand `custom-theme-load-path' into list of directories. +Only existing directories are included in the path returned." (let (lpath) (dolist (f custom-theme-load-path) (cond ((eq f 'custom-theme-directory)