diff --git a/lisp/custom.el b/lisp/custom.el index 076790b661..f08a8e9c3e 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -1291,7 +1291,9 @@ custom-available-themes (let ((suffix "-theme\\.el\\'") themes) (dolist (dir (custom-theme--load-path)) - ;; `custom-theme--load-path' promises DIR exists and is a directory. + (cl-assert + (file-directory-p dir) t + "Non-existent directory in `custom-theme-load-path' expansion: %s") (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)