Fix vanilla sandbox creating too many temp files
On every execution.
This commit is contained in:
parent
9756a0a18c
commit
1530cdbdb6
1 changed files with 16 additions and 17 deletions
|
@ -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 ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue