From 3d977d8f05177b654312f7035eea5fc7a18faad6 Mon Sep 17 00:00:00 2001 From: Jonathan Arnett Date: Sat, 4 Feb 2023 13:02:15 -0500 Subject: [PATCH] Delete -emacs-elixir-format files --- elixir-format.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/elixir-format.el b/elixir-format.el index aec3866c..abd05992 100644 --- a/elixir-format.el +++ b/elixir-format.el @@ -114,11 +114,12 @@ files in subdirectories." (setq our-elixir-format-arguments (append our-elixir-format-arguments elixir-format-arguments))) (setq our-elixir-format-arguments (append our-elixir-format-arguments (list tmpfile))) - (if (zerop (elixir-format--from-mix-root (elixir-format--mix-executable) (elixir-format--errbuff) our-elixir-format-arguments)) - (elixir-format--call-format-command tmpfile) - (elixir-format--failed-to-format called-interactively-p)) - (delete-file tmpfile) - (kill-buffer (elixir-format--outbuff)))) + (unwind-protect + (if (zerop (elixir-format--from-mix-root (elixir-format--mix-executable) (elixir-format--errbuff) our-elixir-format-arguments)) + (elixir-format--call-format-command tmpfile) + (elixir-format--failed-to-format called-interactively-p)) + (delete-file tmpfile) + (kill-buffer (elixir-format--outbuff))))) (defun elixir-format--call-format-command (tmpfile) (if (zerop (call-process-region (point-min) (point-max) "diff" nil (elixir-format--outbuff) nil "-n" "-" tmpfile))