[Adding tramp-devel to Cc]

Daniel Martín <[email protected]> writes:

> Hi, Michael:

Hi Daniel,

> I have a server with a command line tool that formats code and I'd like
> to run this tool on an Emacs region via TRAMP.  I tried to use
> shell-command-on-region, but it seems like it isn't compatible with
> TRAMP, as it's based on call-process-on-region (see your answer here:
> https://emacs.stackexchange.com/questions/69214/using-shell-command-on-region-with-tramp).
>
> Does TRAMP or Emacs provide any alternative to shell-command-on-region
> that works on remote hosts?  The formatting tool needs to read a style
> file that is in a parent folder of the remote host, so Emacs would need
> to run the tool and use the remote directory as part of the environment,
> so that it can locate the file correctly.

No, there's nothing in Tramp. It was discussed recently in the bug
tracker, <https://debbugs.gnu.org/53302>. But as you see, there's no
enthusiam to add this to Emacs. (Lars is one of the Emacs maintainers.)

What you could try is to advice shell-command-on-region, that, in case
of a remote default-directory, it calls process-file instead of call-process.

> Thank you!

Best regards, Michael.

Reply via email to