From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#33791: 26.1; Eshell on Windows connecting to GNU/Linux machine using TRAMP and plink: env: =?UTF-8?Q?=E2=80=98c:/home/jordan/test.sh=E2=80=99:?= No such file or directory Date: Thu, 27 Dec 2018 14:33:40 +0100 Message-ID: <874lazqekr.fsf@gmx.de> References: <87pntyanho.fsf@gmx.com> <83zhsxap9i.fsf@gnu.org> <875zvluaby.fsf@gmx.de> <83r2e9alte.fsf@gnu.org> <87woo0s9g1.fsf@gmx.com> <83woo08cb7.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1545917577 27335 195.159.176.226 (27 Dec 2018 13:32:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2018 13:32:57 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Jordan Wilson , 33791@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 27 14:32:53 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcVmO-00070f-R0 for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Dec 2018 14:32:53 +0100 Original-Received: from localhost ([127.0.0.1]:52027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcVoV-0007p2-NE for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Dec 2018 08:35:03 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcVoK-0007gp-Gb for bug-gnu-emacs@gnu.org; Thu, 27 Dec 2018 08:34:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcVnW-0004kE-7K for bug-gnu-emacs@gnu.org; Thu, 27 Dec 2018 08:34:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35517) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gcVnW-0004k8-3Y for bug-gnu-emacs@gnu.org; Thu, 27 Dec 2018 08:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gcVnV-0008Pg-V2 for bug-gnu-emacs@gnu.org; Thu, 27 Dec 2018 08:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Dec 2018 13:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33791 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33791-submit@debbugs.gnu.org id=B33791.154591763232323 (code B ref 33791); Thu, 27 Dec 2018 13:34:01 +0000 Original-Received: (at 33791) by debbugs.gnu.org; 27 Dec 2018 13:33:52 +0000 Original-Received: from localhost ([127.0.0.1]:38263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcVnL-0008PG-PP for submit@debbugs.gnu.org; Thu, 27 Dec 2018 08:33:52 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:37321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcVnJ-0008P4-RS for 33791@debbugs.gnu.org; Thu, 27 Dec 2018 08:33:50 -0500 Original-Received: from detlef.gmx.de ([213.220.151.94]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LnOve-1hHbtx09xm-00hcdM; Thu, 27 Dec 2018 14:33:43 +0100 In-Reply-To: <83woo08cb7.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 23 Dec 2018 17:58:36 +0200") X-Provags-ID: V03:K1:14YHgn9LuZzWoeKNfGYTSpK21N14msie1e4nffKszrEocpQ3kb5 IFM1S699iui/yCGffryGOLt2rDbLusg9AdHanYzsIKJREqzBkvKHVO6S3pBTf7YzNV02JWC 0bphmM+gPMqmeXrnjys4XJP3e2Km8wG1xcnjFrnri/vRAuO0HsidSgSuPGR6DCv5R58Ky82 bopjBGQr7011ab7eg0Upw== X-UI-Out-Filterresults: notjunk:1;V03:K0:ANYx+g2dhLM=:63JOYbk/+kaDKU2+VyxfuE OQhgjaTJgusp75wPJaOVpVgrsB0gDse4iaZPC4FUyp31bbJZ5oWk4Jn/VP0bs8BIHnjKc9PrM xv/kLhyQ3OkUjKg22RUylp+iKT+8u/b4OIaDtF5Xre0FERpNxbvIj44fWLG0eHcC+DiwJR1uZ OQ2OUDP3R8xLEuqObIkFI0W9Qms7sxsDV4mwV5TFrNPYoxoKZnKbz5V8L2HsNLREzs2+vuc14 5BQuTW7l3OjPi3bfAD8cA3ekPLXmtrWdDoc/QnVovOf/SGIq44qkq3Fjar0FBYA3fqcuEtupQ HFdowDQr49Iaj0eR0RZQ0ZkgfkmS838Bg8NNBEttosAUX13rLw3Xs00rAMYwe1Gzmwn6Uvjws n2hI3h9t8pPSko2yz/d1HhuCPZtoQ/cf7FLE3Grt5HrQuBJZhyiW1BtkEFubbx7Dh1huUMM0C bVgGObA4O831ClBsAe8isO0T39NPizUHQw7xIS6BFw2EL3nJaFfbNyiptiQfvrclszrz1rRMP t8rXzOjfedO5vb5cM8SCSjLpDc7WN3OFICbZLggVjA7WLl/VGzpNlALKw0ZHep+LHr5GRLn0/ 7H+EYaUExfCMk/dAHo3YPE84T0FxfIWZm24YMXwlg6aEHZemlLjQTUvv9B0GmTjixUVH5AsxN SFk0cHXqkZRMVGwRWFk5dwrHRgKxv2v5tVMPETOjgwx9JIhoRQEUlG2O+W5PXrjQZp82FMgKz /RAbfcBME81S12tdv5mJB28iw2xmdBDw7m5w1RcCAfoaXKmF3wMQBAOi72JLT0/hX3L/HgHK X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153901 Archived-At: Eli Zaretskii 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.