-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-gutter+-stage-hunks doesn't work across Tramp #17
Comments
AIUI, the trouble is that |
Running the following code (cobbled together from the Git history over at https://github.com/emacsmirror/tramp) gets the hunk feature working remotely. Note that (defun tramp-sh-handle-call-process-region
(start end program &optional delete buffer display &rest args)
"Like `call-process-region' for Tramp files."
(let ((tmpfile (tramp-compat-make-temp-file "")))
(write-region start end tmpfile)
(when delete (delete-region start end))
(unwind-protect
(apply 'process-file program tmpfile buffer display args)
(delete-file tmpfile))))
(defadvice call-process-region
(around tramp-advice-call-process-region activate)
"Invoke `tramp-sh-handle-call-process-region' for Tramp files."
(if (eq (tramp-find-foreign-file-name-handler default-directory)
'tramp-sh-file-name-handler)
(setq ad-return-value
(apply 'tramp-sh-handle-call-process-region (ad-get-args 0)))
ad-do-it))
|
Pull request #18 is a cleaned-up version of the above. |
Steps to reproduce:
Result:
Platform details:
Emacs for Mac OS X (from http://emacsformacosx.com/), emacs-version 24.4.50.1
The text was updated successfully, but these errors were encountered: