From c62262736ca9fd5a012565fb5ab50e2dd4ff6a4b Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Tue, 27 Apr 2021 23:10:05 +0200 Subject: [PATCH] * 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. --- lisp/startup.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.39.5