[Top][All Lists]

[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 <> 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:
> 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, <>. 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

[Prev in Thread] Current Thread [Next in Thread]