diff options
Diffstat (limited to 'tw/home')
-rw-r--r-- | tw/home/files/emacs-init.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tw/home/files/emacs-init.el b/tw/home/files/emacs-init.el index 72c75799..a924db56 100644 --- a/tw/home/files/emacs-init.el +++ b/tw/home/files/emacs-init.el @@ -873,9 +873,13 @@ For use in `org-latex-classes'." (defun tw/find-asd-systems (directory) "Return a list of Common Lisp .asd systems found in DIRECTORY." (let ((asd-rx (rx ".asd" eos))) - (mapcar (lambda (file) - (string-trim-right file asd-rx)) - (directory-files directory nil asd-rx)))) + ;; `locate-dominating-file' will call this function once with the original + ;; file name as DIRECTORY, but `directory-files' fails if its argument is + ;; a regular file, so protect against this. + (and (directory-name-p directory) + (mapcar (lambda (file) + (string-trim-right file asd-rx)) + (directory-files directory nil asd-rx))))) (defun tw/lisp-project-setup () "Set up a Lisp REPL for the current project." |