What is the remote variant of
call-process-region or an easy way to implement it?
(let ((fh (find-file-name-handler default-directory 'call-process-region))) (apply fh #'call-process-region ...))
But this fails with unsupported i/o primitive.
tramp itself (as part of emacs-25.2) has a
tramp-call-process-region function which I tried to use in a way like
(with-parsed-tramp-file-name default-directory v (apply #'tramp-call-process-region v ...))
But this seems to execute the process on the local machine.
Some packages implement the functionality manually by copying buffer content into a temporary file in the remote site and call
process-file in it. But code is non trivial.