unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* New functions remote-exec-path and remote-executable-find
@ 2018-06-18 15:16 Michael Albinus
  2018-06-18 15:59 ` Robert Pluim
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Michael Albinus @ 2018-06-18 15:16 UTC (permalink / raw)
  To: emacs-devel

Hi,

these days I'm working on bug#31704. The point is, that for searching of
programs, always `exec-path' (a list of local directories) is taken,
even if the shell runs on a remote host. Therefore, I propose a new
function `remote-exec-path'. In case of a remote `default-directory',
the function returns a list of directories which belong to that
host. Implemented via file name handlers. For a local
`default-directory', `exec-path' is returned.

And while we are at this, a second new function `remote-executable-find'
comes to mind. Like `executable-find', it returns the local absolute
file name of a command, also determined by `default-directory'. This
function doesn't need file name handlers, it would use
`remote-exec-path' for its implementation.

I don't need `remote-executable-find' for fixing bug#31704, but I
remember that such a function has been asked for in the past.

Comments?

Best regards, Michael.



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

* Re: New functions remote-exec-path and remote-executable-find
  2018-06-18 15:16 New functions remote-exec-path and remote-executable-find Michael Albinus
@ 2018-06-18 15:59 ` Robert Pluim
  2018-06-18 16:47   ` Michael Albinus
  2018-06-19  1:19 ` Stefan Monnier
  2018-07-01 17:27 ` Philipp Stephani
  2 siblings, 1 reply; 8+ messages in thread
From: Robert Pluim @ 2018-06-18 15:59 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-devel

Michael Albinus <michael.albinus@gmx.de> writes:

> Hi,
>
> these days I'm working on bug#31704. The point is, that for searching of
> programs, always `exec-path' (a list of local directories) is taken,
> even if the shell runs on a remote host. Therefore, I propose a new
> function `remote-exec-path'. In case of a remote `default-directory',
> the function returns a list of directories which belong to that
> host. Implemented via file name handlers. For a local
> `default-directory', `exec-path' is returned.
>
> And while we are at this, a second new function `remote-executable-find'
> comes to mind. Like `executable-find', it returns the local absolute
> file name of a command, also determined by `default-directory'. This
> function doesn't need file name handlers, it would use
> `remote-exec-path' for its implementation.
>
> I don't need `remote-executable-find' for fixing bug#31704, but I
> remember that such a function has been asked for in the past.

Hmm, is this not what connection-local variables are for?

Robert



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

* Re: New functions remote-exec-path and remote-executable-find
  2018-06-18 15:59 ` Robert Pluim
@ 2018-06-18 16:47   ` Michael Albinus
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Albinus @ 2018-06-18 16:47 UTC (permalink / raw)
  To: emacs-devel

Robert Pluim <rpluim@gmail.com> writes:

Hi Robert,,
>
>> these days I'm working on bug#31704. The point is, that for searching of
>> programs, always `exec-path' (a list of local directories) is taken,
>> even if the shell runs on a remote host. Therefore, I propose a new
>> function `remote-exec-path'. In case of a remote `default-directory',
>> the function returns a list of directories which belong to that
>> host. Implemented via file name handlers. For a local
>> `default-directory', `exec-path' is returned.
>
> Hmm, is this not what connection-local variables are for?

Usually yes. But we cannot change `exec-path' to another
connection-local value. If you are visiting a remote buffer, you still
want to call local programs, finding their absolute file name on your
local host.

> Robert

Best regards, Michael.



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

* Re: New functions remote-exec-path and remote-executable-find
  2018-06-18 15:16 New functions remote-exec-path and remote-executable-find Michael Albinus
  2018-06-18 15:59 ` Robert Pluim
@ 2018-06-19  1:19 ` Stefan Monnier
  2018-06-19  8:16   ` Michael Albinus
  2018-07-01 17:27 ` Philipp Stephani
  2 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2018-06-19  1:19 UTC (permalink / raw)
  To: emacs-devel

> these days I'm working on bug#31704. The point is, that for searching of
> programs, always `exec-path' (a list of local directories) is taken,
> even if the shell runs on a remote host. Therefore, I propose a new
> function `remote-exec-path'. In case of a remote `default-directory',
> the function returns a list of directories which belong to that
> host. Implemented via file name handlers. For a local
> `default-directory', `exec-path' is returned.

I think we could even name it just `exec-path`.  IIRC they'd be built by
examining the $PATH of the remote shell, right?

But I wonder: wouldn't there also be a need sometimes to *modify* these
(remote) exec-paths?


        Stefan




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

* Re: New functions remote-exec-path and remote-executable-find
  2018-06-19  1:19 ` Stefan Monnier
@ 2018-06-19  8:16   ` Michael Albinus
  2018-06-19 12:52     ` Michael Albinus
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2018-06-19  8:16 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Hi Stefan,

>> these days I'm working on bug#31704. The point is, that for searching of
>> programs, always `exec-path' (a list of local directories) is taken,
>> even if the shell runs on a remote host. Therefore, I propose a new
>> function `remote-exec-path'. In case of a remote `default-directory',
>> the function returns a list of directories which belong to that
>> host. Implemented via file name handlers. For a local
>> `default-directory', `exec-path' is returned.
>
> I think we could even name it just `exec-path`.  IIRC they'd be built by
> examining the $PATH of the remote shell, right?

Yes, it's a better name. The value is not derived from the remote $PATH,
but from `tramp-remote-path'

The name `remote-executable-find' (or something else, different from
`executable-find') must be kept. `executable-find' is supposed to work
on the local host.

> But I wonder: wouldn't there also be a need sometimes to *modify* these
> (remote) exec-paths?

Yes, perhaps. Until now there's even no such mean.

Tramp uses internally the function `tramp-get-remote-path', which caches
the result. Every cache cleanup will trigger to recalculate the result
from `tramp-remote-path'. People could make that variable
connection-local, and change it as needed.

Let's see how this works in practice, and if needed, we could extend the
interface.

>         Stefan

Best regards, Michael.



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

* Re: New functions remote-exec-path and remote-executable-find
  2018-06-19  8:16   ` Michael Albinus
@ 2018-06-19 12:52     ` Michael Albinus
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Albinus @ 2018-06-19 12:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Michael Albinus <michael.albinus@gmx.de> writes:

> The name `remote-executable-find' (or something else, different from
> `executable-find') must be kept. `executable-find' is supposed to work
> on the local host.

Or maybe we use `executable-find' indeed, adding an optional argument
REMOTE, which indicates that the executable shall be searched on the
remote host indicated by `default-directory'.

Best regards, Michael.



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

* Re: New functions remote-exec-path and remote-executable-find
  2018-06-18 15:16 New functions remote-exec-path and remote-executable-find Michael Albinus
  2018-06-18 15:59 ` Robert Pluim
  2018-06-19  1:19 ` Stefan Monnier
@ 2018-07-01 17:27 ` Philipp Stephani
  2018-07-01 17:41   ` Michael Albinus
  2 siblings, 1 reply; 8+ messages in thread
From: Philipp Stephani @ 2018-07-01 17:27 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1159 bytes --]

Michael Albinus <michael.albinus@gmx.de> schrieb am Mo., 18. Juni 2018 um
17:17 Uhr:

> Hi,
>
> these days I'm working on bug#31704. The point is, that for searching of
> programs, always `exec-path' (a list of local directories) is taken,
> even if the shell runs on a remote host. Therefore, I propose a new
> function `remote-exec-path'. In case of a remote `default-directory',
> the function returns a list of directories which belong to that
> host. Implemented via file name handlers. For a local
> `default-directory', `exec-path' is returned.
>
> And while we are at this, a second new function `remote-executable-find'
> comes to mind. Like `executable-find', it returns the local absolute
> file name of a command, also determined by `default-directory'. This
> function doesn't need file name handlers, it would use
> `remote-exec-path' for its implementation.
>
> I don't need `remote-executable-find' for fixing bug#31704, but I
> remember that such a function has been asked for in the past.
>
> Comments?
>

There have been multiple occasions where such functions would have been
handy for me, so I'm strongly in favor of adding them. Thanks!

[-- Attachment #2: Type: text/html, Size: 1554 bytes --]

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

* Re: New functions remote-exec-path and remote-executable-find
  2018-07-01 17:27 ` Philipp Stephani
@ 2018-07-01 17:41   ` Michael Albinus
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Albinus @ 2018-07-01 17:41 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: emacs-devel

Philipp Stephani <p.stephani2@gmail.com> writes:

Hi Philipp,

> There have been multiple occasions where such functions would have
> been handy for me, so I'm strongly in favor of adding them. Thanks!

That's already committed to master. The names have changed, it is
`exec-path' now, and still `executable-find' but with an optional argument.

Best regards, Michael.



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

end of thread, other threads:[~2018-07-01 17:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 15:16 New functions remote-exec-path and remote-executable-find Michael Albinus
2018-06-18 15:59 ` Robert Pluim
2018-06-18 16:47   ` Michael Albinus
2018-06-19  1:19 ` Stefan Monnier
2018-06-19  8:16   ` Michael Albinus
2018-06-19 12:52     ` Michael Albinus
2018-07-01 17:27 ` Philipp Stephani
2018-07-01 17:41   ` Michael Albinus

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).