From 290681cb67f3ecc20315040f3a0fe25c0ad5e453 Mon Sep 17 00:00:00 2001 From: Milo Davis Date: Thu, 28 Sep 2017 09:46:49 +0200 Subject: [PATCH] Emacs: deletes temporary files after use (Github issue #120) --- emacs/michelson-mode.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/emacs/michelson-mode.el b/emacs/michelson-mode.el index dbbdddb83..ddd4d9bff 100644 --- a/emacs/michelson-mode.el +++ b/emacs/michelson-mode.el @@ -390,12 +390,9 @@ Overrides `michelson-print-errors' and `michelson-highlight-errors'" (list "typecheck" "program" - (let ((file-name - (make-temp-file (buffer-name)))) - (write-region (point-min) (point-max) file-name nil 'no-message) - (if michelson-alphanet - (concat "container:" file-name) - file-name)) + (if michelson-alphanet + (concat "container:" tmp-file) + tmp-file) "-details" "-emacs")))) (michelson-async-command-to-string @@ -406,7 +403,8 @@ Overrides `michelson-print-errors' and `michelson-highlight-errors'" ((record (car (read-from-string output))) (errors (cdr (assoc 'errors record))) (types (cdr (assoc 'types record)))) - (setq michelson-cached-buffer-info (make-cache :types types :errors errors))) + (setq michelson-cached-buffer-info (make-cache :types types :errors errors)) + (delete-file tmp-file)) ((error err) (let ((inhibit-message t)) (message output)))))))))