unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Remote process execution
@ 2021-06-22 22:29 Aidan Gauland
  2021-06-24 18:01 ` Michael Albinus
  2021-06-26 18:37 ` Philipp
  0 siblings, 2 replies; 4+ messages in thread
From: Aidan Gauland @ 2021-06-22 22:29 UTC (permalink / raw)
  To: emacs-devel

I am trying to modify a third-party package to work over TRAMP, and I am 
stuck on `call-process-region'.  I seem to be able to use `process-file' 
as a drop-in replacement for `call-process', but there does not appear 
to be any substitute for `call-process-region'.  I did find 
`tramp-call-process-region' (and `tramp-call-process'), but these 
functions seem to be redundant, since they just call the process on the 
local host, which is what the non-tramp versions of these functions do 
already.

Can anyone offer advice on modifying code that uses 
`call-process-region' to handle remote-command-execution in TRAMP buffers?

Regards,
Aidan Gauland





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Remote process execution
  2021-06-22 22:29 Remote process execution Aidan Gauland
@ 2021-06-24 18:01 ` Michael Albinus
  2021-06-24 20:24   ` Tomas Hlavaty
  2021-06-26 18:37 ` Philipp
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2021-06-24 18:01 UTC (permalink / raw)
  To: Aidan Gauland; +Cc: emacs-devel

Aidan Gauland <aidalgol@fastmail.net> writes:

Hi Aidan,

> I am trying to modify a third-party package to work over TRAMP, and I
> am stuck on `call-process-region'.  I seem to be able to use
> `process-file' as a drop-in replacement for `call-process', but there
> does not appear to be any substitute for `call-process-region'.  I did
> find `tramp-call-process-region' (and `tramp-call-process'), but these
> functions seem to be redundant, since they just call the process on
> the local host, which is what the non-tramp versions of these
> functions do already.

Like call-process, call-process-region does not support remote
directories. As you say, there is process-file, which does this with the
same arguments as call-process.

tramp-call-process and tramp-call-process-region are internal
functions. Their docstrings say clearly, that they are based on
call-process and call-process-region, respectively.

> Can anyone offer advice on modifying code that uses
> `call-process-region' to handle remote-command-execution in TRAMP
> buffers?

What you are looking for is an implementation for
process-file-region. That does not exist (yet?), AFAIK.

> Regards,
> Aidan Gauland

Best regards, Michael.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Remote process execution
  2021-06-24 18:01 ` Michael Albinus
@ 2021-06-24 20:24   ` Tomas Hlavaty
  0 siblings, 0 replies; 4+ messages in thread
From: Tomas Hlavaty @ 2021-06-24 20:24 UTC (permalink / raw)
  To: Michael Albinus, Aidan Gauland; +Cc: emacs-devel

On Thu 24 Jun 2021 at 20:01, Michael Albinus <michael.albinus@gmx.de> wrote:
> Aidan Gauland <aidalgol@fastmail.net> writes:
>> Can anyone offer advice on modifying code that uses
>> `call-process-region' to handle remote-command-execution in TRAMP
>> buffers?
>
> What you are looking for is an implementation for
> process-file-region. That does not exist (yet?), AFAIK.

what about process-file-shell-command with pipe, something like this:

(format "head -c %d | tail -c %d | program" end (- end begin))

it's far from perfect but might do for your use-case



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Remote process execution
  2021-06-22 22:29 Remote process execution Aidan Gauland
  2021-06-24 18:01 ` Michael Albinus
@ 2021-06-26 18:37 ` Philipp
  1 sibling, 0 replies; 4+ messages in thread
From: Philipp @ 2021-06-26 18:37 UTC (permalink / raw)
  To: Aidan Gauland; +Cc: emacs-devel



> Am 23.06.2021 um 00:29 schrieb Aidan Gauland <aidalgol@fastmail.net>:
> 
> I am trying to modify a third-party package to work over TRAMP, and I am stuck on `call-process-region'.  I seem to be able to use `process-file' as a drop-in replacement for `call-process', but there does not appear to be any substitute for `call-process-region'.  I did find `tramp-call-process-region' (and `tramp-call-process'), but these functions seem to be redundant, since they just call the process on the local host, which is what the non-tramp versions of these functions do already.
> 
> Can anyone offer advice on modifying code that uses `call-process-region' to handle remote-command-execution in TRAMP buffers?

What I typically do is write the region into a temporary file (using `make-nearby-temp-file' and `write-region') and then call `process-file'.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-26 18:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 22:29 Remote process execution Aidan Gauland
2021-06-24 18:01 ` Michael Albinus
2021-06-24 20:24   ` Tomas Hlavaty
2021-06-26 18:37 ` Philipp

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).