unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: yyoncho <yyoncho@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: tramp and executable-find
Date: Sat, 20 Jun 2020 21:27:38 +0300	[thread overview]
Message-ID: <CACCVLQWMGO+aRM=-Su2Eb-CsOhRLaJyeh=FQcqeMiHL06NE4VQ@mail.gmail.com> (raw)
In-Reply-To: <CACCVLQWQBGh69vHumQZMjKZ2uURjkoU9MBVBPFR_Ft7s-h7-0w@mail.gmail.com>

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

Here it is an example:

Copy ls from /bin/ and name it lss.

Then:

;; works
(let ((default-directory "<remote-path>"))
  (executable-find "lss" 'remote))

;; does not work
(let ((default-directory "<remote-path>"))
  (executable-find "/bin/lss" 'remote))

Thanks,
Ivan

On Sat, Jun 20, 2020 at 9:23 PM yyoncho <yyoncho@gmail.com> wrote:

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

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

  reply	other threads:[~2020-06-20 18:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20 15:22 tramp and executable-find Ivan Yonchovski
2020-06-20 16:47 ` Michael Albinus
2020-06-20 17:00   ` Philipp Stephani
2020-06-20 17:08   ` yyoncho
2020-06-20 17:43     ` Michael Albinus
2020-06-20 18:23       ` yyoncho
2020-06-20 18:27         ` yyoncho [this message]
2020-06-20 19:14           ` Michael Albinus
2020-06-20 19:29             ` yyoncho
2020-06-21  7:16               ` Michael Albinus
2020-06-21  8:41                 ` yyoncho
2020-06-21  9:34                   ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACCVLQWMGO+aRM=-Su2Eb-CsOhRLaJyeh=FQcqeMiHL06NE4VQ@mail.gmail.com' \
    --to=yyoncho@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).