emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp and executable-find


From: yyoncho
Subject: Re: tramp and executable-find
Date: Sat, 20 Jun 2020 21:23:15 +0300

Hi Michael,

The examples that do not work on my side are when using a full
file path when the binary is not on remote PATH.

Thanks,
Ivan

On Sat, Jun 20, 2020 at 8:43 PM Michael Albinus <michael.albinus@gmx.de> wrote:
yyoncho <yyoncho@gmail.com> writes:

> Hi Michael,

Hi Ivan,

> Can you comment on remote flag mentioned by Philip as well?
>
> Here it is the docs for it:
>
> REMOTE is non-nil, search on the remote host indicated by
> `default-directory' instead.

Right, I forgot this. Sorry. So let's go back to your question:

>> As part of investigating
>> https://github.com/emacs-lsp/lsp-mode/issues/1688 I noticed that
>> executable-find does not return the binary when it is not on the
>> remote PATH(or at least this is what I see) even if you specify the
>> full path to the binary. Can you comment if this is the expected
>> behaviour?

The crucial point is `default-directory'. In my local environment, I
have for example

--8<---------------cut here---------------start------------->8---
(let ((default-directory "/tmp"))
  (executable-find "emacs"))
"/usr/local/bin/emacs"

(let ((default-directory "/tmp"))
  (executable-find "emacs" 'remote))
"/usr/local/bin/emacs"

(let ((default-directory "/ssh:ford:"))
  (executable-find "emacs"))
"/usr/local/bin/emacs"

(let ((default-directory "/ssh:ford:"))
  (executable-find "emacs" 'remote))
"/opt/bin/emacs"
--8<---------------cut here---------------end--------------->8---

You get the remote path only if `default-directory' is a remote file
name, and the REMOTE argument of `executable-find' is non-nil. And this
is understandable: if `default-directory' is not a remote file name,
`executable-find' does not know which remote host it shall use for search.

> Thanks,
> Ivan

Best regards, Michael.

reply via email to

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