Emacs: deletes temporary files after use (Github issue #120)

This commit is contained in:
Milo Davis 2017-09-28 09:46:49 +02:00
parent c2fd13f3ab
commit 290681cb67

View File

@ -390,12 +390,9 @@ Overrides `michelson-print-errors' and `michelson-highlight-errors'"
(list (list
"typecheck" "typecheck"
"program" "program"
(let ((file-name
(make-temp-file (buffer-name))))
(write-region (point-min) (point-max) file-name nil 'no-message)
(if michelson-alphanet (if michelson-alphanet
(concat "container:" file-name) (concat "container:" tmp-file)
file-name)) tmp-file)
"-details" "-details"
"-emacs")))) "-emacs"))))
(michelson-async-command-to-string (michelson-async-command-to-string
@ -406,7 +403,8 @@ Overrides `michelson-print-errors' and `michelson-highlight-errors'"
((record (car (read-from-string output))) ((record (car (read-from-string output)))
(errors (cdr (assoc 'errors record))) (errors (cdr (assoc 'errors record)))
(types (cdr (assoc 'types 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) ((error err)
(let ((inhibit-message t)) (let ((inhibit-message t))
(message output))))))))) (message output)))))))))