summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2023-01-29 09:44:53 +0200
committerEli Zaretskii <eliz@gnu.org>2023-01-29 09:44:53 +0200
commit56e8607dc99b90c43f82001cbf073e58a4698298 (patch)
treec6e2ac0cc17a9cb3c736f41747c2e6f78709ab03 /lisp/emacs-lisp
parent2bd0b9475384adfb4dd2cc794bbe1d8621546717 (diff)
downloademacs-56e8607dc99b90c43f82001cbf073e58a4698298.tar.gz
emacs-56e8607dc99b90c43f82001cbf073e58a4698298.tar.bz2
emacs-56e8607dc99b90c43f82001cbf073e58a4698298.zip
Fix spurious errors on Windows when deleting temporary *.eln files
* lisp/emacs-lisp/comp.el (comp--native-compile): On MS-Windows, ignore errors when deleting a temporary .eln file. (Bug#60996)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/comp.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 49e3cdb8de7..7ba8e956fb2 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -4112,13 +4112,16 @@ the deferred compilation mechanism."
(native-elisp-load data)))
;; We may have created a temporary file when we're being
;; called with something other than a file as the argument.
- ;; Delete it.
+ ;; Delete it if we can.
(when (and (not (stringp function-or-file))
(not output)
comp-ctxt
(comp-ctxt-output comp-ctxt)
(file-exists-p (comp-ctxt-output comp-ctxt)))
- (delete-file (comp-ctxt-output comp-ctxt))))))))
+ (cond ((eq 'windows-nt system-type)
+ ;; We may still be using the temporary .eln file.
+ (ignore-errors (delete-file (comp-ctxt-output comp-ctxt))))
+ (t (delete-file (comp-ctxt-output comp-ctxt))))))))))
(defun native-compile-async-skip-p (file load selector)
"Return non-nil if FILE's compilation should be skipped.