From: Andrea Corallo Date: Tue, 27 Apr 2021 21:10:05 +0000 (+0200) Subject: * Clean-up temporary eln test-suite directory when exiting (bug#48060) X-Git-Tag: emacs-28.0.90~2684 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c62262736ca9fd5a012565fb5ab50e2dd4ff6a4b;p=emacs.git * Clean-up temporary eln test-suite directory when exiting (bug#48060) * lisp/startup.el (normal-top-level): Remove eln test-suite temp dir when exiting. --- diff --git a/lisp/startup.el b/lisp/startup.el index a21372a0463..3513ab7c4ec 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -550,7 +550,9 @@ It is the default value of the variable `top-level'." ;; testsuite, add a temporary folder in front to produce there ;; new compilations. (when (equal (getenv "HOME") "/nonexistent") - (push (make-temp-file "emacs-testsuite-" t) comp-eln-load-path))) + (let ((tmp-dir (make-temp-file "emacs-testsuite-" t))) + (add-hook 'kill-emacs-hook (lambda () (delete-directory tmp-dir t))) + (push tmp-dir comp-eln-load-path)))) ;; Look in each dir in load-path for a subdirs.el file. If we ;; find one, load it, which will add the appropriate subdirs of ;; that dir into load-path. This needs to be done before setting