Fix vanilla sandbox creating too many temp files

On every execution.
This commit is contained in:
Henrik Lissner 2018-07-02 23:32:11 +02:00
parent 9756a0a18c
commit 1530cdbdb6
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -128,9 +128,9 @@ branch and commit."
(defun doom--run-vanilla-sandbox () (defun doom--run-vanilla-sandbox ()
"TODO" "TODO"
(interactive) (interactive)
(when (equal (buffer-name) "*doom:vanilla-sandbox*") (let ((contents (buffer-string))
(let ((file (make-temp-file "doom-eval-"))) (file (make-temp-file "/tmp/doom-eval-")))
(write-file file) (with-temp-file file (insert contents))
(require 'pp) (require 'pp)
(require 'restart-emacs) (require 'restart-emacs)
(restart-emacs--launch-other-emacs (restart-emacs--launch-other-emacs
@ -143,8 +143,7 @@ branch and commit."
package-archives ',package-archives package-archives ',package-archives
debug-on-error t)) debug-on-error t))
"-f" "package-initialize" "-f" "package-initialize"
"-l" file "--eval" (prin1-to-string `(unwind-protect (load ,file) (delete-file ,file)))))))
"--eval" (prin1-to-string `(delete-file ,file)))))))
;;;###autoload ;;;###autoload
(defun doom/open-vanilla-sandbox () (defun doom/open-vanilla-sandbox ()