unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Jordan Wilson <jordan.t.wilson@gmx.com>, 33791@debbugs.gnu.org
Subject: bug#33791: 26.1; Eshell on Windows connecting to GNU/Linux machine using TRAMP and plink: env: ‘c:/home/jordan/test.sh’: No such file or directory
Date: Thu, 27 Dec 2018 14:33:40 +0100	[thread overview]
Message-ID: <874lazqekr.fsf@gmx.de> (raw)
In-Reply-To: <83woo08cb7.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 23 Dec 2018 17:58:36 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

>> Evaluating:
>> 
>>      (locate-file-internal ".." '("./") nil (lambda (f) (message f)))
>> 
>> while in "/plink:jordan@domain.com:/home/jordan/test" returns
>> "c:/plink:jordan@domain.com:/home/jordan". Whilst
>> 
>>      (locate-file-internal ".."
>>             '("/plink:jordan@domain.com:/home/jordan/test")
>>              nil (lambda (f) (message f)))
>> 
>> correctly returns "/plink:jordan@domain.com:/home/jordan".
>> 
>> It seems the problem is something to do with converting from a
>> relative to absolute path. Eval'ing (expand-file-name "..") correctly
>> returns "/plink:jordan@domain.com:/home/jordan", though. Strange.
>
> Right you are, thanks.  The problem is that locate-file doesn't
> support remote file names.  Does the patch below produce good results?
>
> Michael, do you agree with this solution?  Do you think it's safe
> enough to put it on the release branch (it's a regression from a few
> years ago)?

I've tried to debug it, but no chance to do it on Windows.
Debugging C sources is a no-go for me there.

> diff --git a/lisp/files.el b/lisp/files.el
> index eb09a7c..cfe67b4 100644
> --- a/lisp/files.el
> +++ b/lisp/files.el
> @@ -801,9 +801,15 @@ cd
>      (setq cd-path (or (parse-colon-path (getenv "CDPATH"))
>                        (list "./"))))
>    (cd-absolute
> -   (or (locate-file dir cd-path nil
> -                    (lambda (f) (and (file-directory-p f) 'dir-ok)))
> -       (error "No such directory found via CDPATH environment variable"))))
> +   (or
> +    ;; locate-file doesn't support remote file names, so detect them
> +    ;; and support them here by hand.
> +    (and (file-name-absolute-p (expand-file-name dir))
> +         (file-accessible-directory-p (expand-file-name dir))
> +         (expand-file-name dir))
> +    (locate-file dir cd-path nil
> +                 (lambda (f) (and (file-directory-p f) 'dir-ok)))
> +    (error "No such directory found via CDPATH environment variable"))))
>  
>  (defun directory-files-recursively (dir regexp &optional include-directories)
>    "Return list of all files under DIR that have file names matching REGEXP.

Works for me, also on Windows, but I have modified it slightly in order
to make it more explicit. I have applied

> +   (or
> +    ;; locate-file doesn't support remote file names, so detect them
> +    ;; and support them here by hand.
> +    (and (file-remote-p (expand-file-name dir))
...

It is also OK for me to push it to the emacs-26 branch.

Best regards, Michael.





  parent reply	other threads:[~2018-12-27 13:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 15:00 bug#33791: 26.1; Eshell on Windows connecting to GNU/Linux machine using TRAMP and plink: env: ‘c:/home/jordan/test.sh’: No such file or directory Jordan Wilson
2018-12-22  9:23 ` Eli Zaretskii
2018-12-22 10:25   ` Michael Albinus
2018-12-22 10:38     ` Eli Zaretskii
2018-12-22 12:35       ` Michael Albinus
2018-12-22 14:36         ` Eli Zaretskii
2018-12-22 15:54       ` Jordan Wilson
2018-12-23 12:40       ` Jordan Wilson
2018-12-23 15:58         ` Eli Zaretskii
2018-12-23 16:42           ` Michael Albinus
2018-12-23 16:51             ` Eli Zaretskii
2018-12-27 13:33           ` Michael Albinus [this message]
2018-12-28  8:15             ` Eli Zaretskii
2018-12-28 17:23               ` Jordan Wilson
2018-12-28 18:48                 ` Eli Zaretskii
2018-12-28 19:25                   ` Jordan Wilson
2018-12-29  9:10                     ` Eli Zaretskii
2018-12-29  9:25                       ` Michael Albinus
2018-12-29 10:00                         ` Eli Zaretskii
2018-12-29 11:12                           ` Michael Albinus
2018-12-29 13:43                             ` Jordan Wilson
2018-12-29 14:19                               ` Michael Albinus
2018-12-29 15:36                             ` Eli Zaretskii
2018-12-29  9:14                     ` Michael Albinus
2018-12-29  8:18             ` Eli Zaretskii
2018-12-29  8:38               ` Michael Albinus
2018-12-29  9:48                 ` Eli Zaretskii
2018-12-29 10:40                   ` Michael Albinus
2018-12-22 15:45   ` Jordan Wilson

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=874lazqekr.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=33791@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jordan.t.wilson@gmx.com \
    /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).