Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions phpactor.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use find-file-noselect instead of find-file.

(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)
Expand Down