[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feature request: new function start-remote-process
From: |
Michael Albinus |
Subject: |
Re: Feature request: new function start-remote-process |
Date: |
Mon, 25 Jun 2007 23:37:01 +0200 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) |
Richard Stallman <address@hidden> writes:
> > start-remote-process shall behave similar: if default-directory points
> > to a remote host, the corresponding program shall be executed there.
>
> Looks like nobody objects. I'll install it next days in the trunk,
> unless there is a veto.
>
> But...how is it possible to do run a program on a remote host?
> In general, there is no way, right?
Why not? Tramp must call programs on a remote host permanently. It opens
a new buffer by
(start-process "name" tramp-buffer "ssh" host "-l" user)
Then it sends the program to that process, and reads the result in the
buffer.
A program can be regarded as the "basename" of an absolute file name.
(let ((default-directory "/ssh:address@hidden:"))
(start-remote-process "example" "*scratch*" "hostname"))
does work in my implementation. It must be specified how the program
"hostname" is found. We've discussed shortly two years ago, how to
use `executable-find' and `exec-path' for that, with no result.
For the time being, I would propose that the search path for a program
on a remote host shall be the result of `getconf PATH` on the remote
host (that's what Tramp 2.1 does by default). If a program is not found
in that path, it could be called by its absolute file name:
(let ((default-directory "/ssh:address@hidden:"))
(start-remote-process "example" "*scratch*" "/bin/hostname"))
However, there must be a better mechanism to define exec-path for remote
hosts. Tramp has an own, proprietary mechanism (see tramp-remote-path);
this needs to be generalized.
Best regards, Michael.magdalene
Re: Feature request: new function start-remote-process, Stefan Monnier, 2007/06/26
Re: Feature request: new function start-remote-process, Stefan Monnier, 2007/06/26