[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Running shell-command-on-region with TRAMP
From: |
Michael Albinus |
Subject: |
Re: Running shell-command-on-region with TRAMP |
Date: |
Fri, 18 Feb 2022 09:31:04 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
[Adding tramp-devel to Cc]
Daniel MartÃn <mardani29@yahoo.es> 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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Running shell-command-on-region with TRAMP,
Michael Albinus <=