From dc4b50ce0b52d8fcade1e04aabd92409858fcfc2 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Mon, 7 Sep 2020 23:13:28 +0200 Subject: [PATCH] * Do not crash compilation if user eln-cache wasn't already created. * lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): Guard against calling `directory-files' on non existent directories. --- lisp/emacs-lisp/comp.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 129a4dedaf9..cfc5ca55488 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2516,8 +2516,9 @@ sharing the original source filename (including FILE)." `(seq "-" ,filename-hash "-" (1+ hex) ".eln" eos)) for dir in (butlast comp-eln-load-path) ; Skip last dir. do (cl-loop - for f in (directory-files (concat dir comp-native-version-dir) t regexp - t) + with full-dir = (concat dir comp-native-version-dir) + for f in (when (file-exists-p full-dir) + (directory-files full-dir t regexp t)) do (comp-delete-or-replace-file f)))) (defun comp-delete-or-replace-file (oldfile &optional newfile) -- 2.39.5