diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-09-14 22:50:21 +0200 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-09-14 23:06:42 +0200 |
commit | e9728375763c61e3b890530b202b856d28c44646 (patch) | |
tree | 9e591e02ca8e3eaff6dc966a96887b2fcb73a01b /lisp/emacs-lisp/comp.el | |
parent | 82171a8f0de6e88566aa0d80388dab135dbc260f (diff) | |
download | emacs-e9728375763c61e3b890530b202b856d28c44646.tar.gz emacs-e9728375763c61e3b890530b202b856d28c44646.tar.bz2 emacs-e9728375763c61e3b890530b202b856d28c44646.zip |
* Fix free function compilation load process.
* lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln): Do not crash
if the eln filename is not canonical (tmp file or manual load).
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r-- | lisp/emacs-lisp/comp.el | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index f1689808eea..25e2de9d5d2 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2509,17 +2509,18 @@ Prepare every function for final compilation and drive the C back-end." (defun comp-clean-up-stale-eln (file) "Given FILE remove all the .eln files in `comp-eln-load-path' sharing the original source filename (including FILE)." - (string-match (rx "-" (group-n 1 (1+ hex)) "-" (1+ hex) ".eln" eos) file) - (cl-loop - with filename-hash = (match-string 1 file) - with regexp = (rx-to-string - `(seq "-" ,filename-hash "-" (1+ hex) ".eln" eos)) - for dir in (butlast comp-eln-load-path) ; Skip last dir. - do (cl-loop - 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)))) + (when (string-match (rx "-" (group-n 1 (1+ hex)) "-" (1+ hex) ".eln" eos) + file) + (cl-loop + with filename-hash = (match-string 1 file) + with regexp = (rx-to-string + `(seq "-" ,filename-hash "-" (1+ hex) ".eln" eos)) + for dir in (butlast comp-eln-load-path) ; Skip last dir. + do (cl-loop + 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) "Replace OLDFILE with NEWFILE. |