Skip to content

Commit

Permalink
Delete -emacs-elixir-format files
Browse files Browse the repository at this point in the history
  • Loading branch information
J3RN committed Feb 4, 2023
1 parent 4974ff9 commit d9306e8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions elixir-format.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit d9306e8

Please sign in to comment.