From d6cb58802d6a8fe4a5548c3498947997514f4c97 Mon Sep 17 00:00:00 2001 From: Brent Hagany Date: Mon, 11 Jun 2018 12:16:33 -0500 Subject: [PATCH] Allow for TRAMP configuration --- prettier-js.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prettier-js.el b/prettier-js.el index 08d90b8..bf8b8e9 100644 --- a/prettier-js.el +++ b/prettier-js.el @@ -164,6 +164,7 @@ a `before-save-hook'." (patchbuf (get-buffer-create "*prettier patch*")) (coding-system-for-read 'utf-8) (coding-system-for-write 'utf-8) + (localname (or (file-remote-p buffer-file-name 'localname) buffer-file-name)) (width-args (cond ((equal prettier-js-width-mode 'window) @@ -184,7 +185,7 @@ a `before-save-hook'." (erase-buffer)) (if (zerop (apply 'call-process prettier-js-command bufferfile (list (list :file outputfile) errorfile) - nil (append prettier-js-args width-args (list "--stdin" "--stdin-filepath" buffer-file-name)))) + nil (append prettier-js-args width-args (list "--stdin" "--stdin-filepath" localname)))) (progn (call-process-region (point-min) (point-max) "diff" nil patchbuf nil "-n" "--strip-trailing-cr" "-" outputfile)