At Thu, 18 Feb 2010 10:47:07 -0500,
Dan Davison wrote:
> I'm curious as to whether this is intended behaviour or a bug, and would
> appreciate any suggestions for a nice way to implement my own version of
> shell-command-on-region (using tramp technology?) that does run
> remotely.

Don't sure that it's nice, but I'm using following function.
It handles whole buffer, not region, which can be easily fixed.

(defun buffer->process-file (program &optional output-buffer display &rest args)
  "Stores current buffer to temporary file, and passes this file
to process-file. In this way we can send buffer contents to
commands on other hosts (via tramp)"
  (let ((temp-buffer (get-buffer-create "*buffer-process-file-temp*"))
        (temp-file-name (make-temp-file "buffer-process-file-temp"))
        (current-buffer (current-buffer)))
    (unwind-protect
        (progn 
          (with-current-buffer temp-buffer
            (erase-buffer)
            (insert-buffer-substring current-buffer)
            (write-file temp-file-name))
          (apply #'process-file program temp-file-name output-buffer display 
args))
      (delete-file temp-file-name))))



_______________________________________________
Tramp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to