From 81c1ef5e83fca32e1c4c578669a4196eb65c581b Mon Sep 17 00:00:00 2001 From: Mikael Kermorgant Date: Tue, 5 Mar 2019 09:35:22 +0200 Subject: [PATCH] fix #95 : use path in phpactor-action-update-file-source --- phpactor.el | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/phpactor.el b/phpactor.el index 57bb9dd..c87ecd9 100644 --- a/phpactor.el +++ b/phpactor.el @@ -457,23 +457,23 @@ function." (patchbuf (get-buffer-create "*Phpactor patch*")) (coding-system-for-read 'utf-8) (coding-system-for-write 'utf-8)) - - (unwind-protect - (save-restriction - (widen) - (with-current-buffer patchbuf - (erase-buffer)) - - (with-temp-file tmpfile - (insert source)) - - (if (zerop (call-process-region (point-min) (point-max) "diff" nil patchbuf nil "-n" "-" tmpfile)) - (message "Buffer was unchanged by phpactor") - (phpactor--apply-rcs-patch patchbuf) - (message "Buffer modified by phpactor"))) - - (kill-buffer patchbuf) - (delete-file tmpfile)))) + (with-current-buffer (find-file path) + (unwind-protect + (save-restriction + (widen) + (with-current-buffer patchbuf + (erase-buffer)) + + (with-temp-file tmpfile + (insert source)) + + (if (zerop (call-process-region (point-min) (point-max) "diff" nil patchbuf nil "-n" "-" tmpfile)) + (message "Buffer was unchanged by phpactor") + (phpactor--apply-rcs-patch patchbuf) + (message "Buffer modified by phpactor"))) + + (kill-buffer patchbuf) + (delete-file tmpfile))))) ;; Dispatcher: (cl-defun phpactor-action-dispatch (&key action parameters version)