From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#34834: 26.1; Remote `eshell/mv' and `eshell/cp' on Windows: Opening output file: Invalid argument, c:/home/ ... Date: Tue, 01 Sep 2020 18:59:07 +0300 Message-ID: <83blipwks4.fsf@gnu.org> References: <87o96f4v47.fsf@gmx.com> <871s2qsxli.fsf@gmx.de> <83lg0ykhsj.fsf@gnu.org> <87wokiriea.fsf@gmx.de> <83h8bmkdbf.fsf@gnu.org> <87sgv6q6bi.fsf@gmx.de> <834l7lkga1.fsf@gnu.org> <87k1ghreyb.fsf@gmx.de> <8336n5kbvi.fsf@gnu.org> <87ftr5r7n0.fsf@gmx.de> <831s2pk1zx.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27622"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jordan.t.wilson@gmx.com, 34834@debbugs.gnu.org To: michael.albinus@gmx.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 01 18:00:22 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kD8hn-00071F-GJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Sep 2020 18:00:19 +0200 Original-Received: from localhost ([::1]:48656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kD8hm-0005XD-CK for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Sep 2020 12:00:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD8hX-0005Vo-3Y for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 12:00:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kD8hW-0003q4-P5 for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 12:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kD8hW-0001QY-N1 for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 12:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Sep 2020 16:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34834 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 34834-submit@debbugs.gnu.org id=B34834.15989759735419 (code B ref 34834); Tue, 01 Sep 2020 16:00:02 +0000 Original-Received: (at 34834) by debbugs.gnu.org; 1 Sep 2020 15:59:33 +0000 Original-Received: from localhost ([127.0.0.1]:56876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kD8h3-0001PL-2n for submit@debbugs.gnu.org; Tue, 01 Sep 2020 11:59:33 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kD8h1-0001P7-Kq for 34834@debbugs.gnu.org; Tue, 01 Sep 2020 11:59:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53854) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kD8gw-0003lX-AU; Tue, 01 Sep 2020 11:59:26 -0400 Original-Received: from [176.228.60.248] (port=1744 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kD8gu-0003B1-St; Tue, 01 Sep 2020 11:59:25 -0400 In-Reply-To: <831s2pk1zx.fsf@gnu.org> (message from Eli Zaretskii on Fri, 29 Mar 2019 20:46:10 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186859 Archived-At: > Date: Fri, 29 Mar 2019 20:46:10 +0300 > From: Eli Zaretskii > Cc: jordan.t.wilson@gmx.com, 34834@debbugs.gnu.org > > > From: Michael Albinus > > Cc: jordan.t.wilson@gmx.com, 34834@debbugs.gnu.org > > Date: Fri, 29 Mar 2019 17:02:27 +0100 > > > > While you are at this, do you have a chance to check bug#26911? It is > > another problem, but also somewhere in Fexpand_file_name. > > Will do. And then I didn't. Re-reading all that discussion now, I come to the conclusion that I need your help, Michael, to understand your analysis in more detail. Back then, you said: > ====================================================================== > 1 -> (expand-file-name "123" "tmp/") > | 2 -> (tramp-file-name-handler expand-file-name "tmp/" "/plinkx:detlefx:/home/albinus/") > | | 3 -> (tramp-sh-handle-expand-file-name "tmp/" "/plinkx:detlefx:/home/albinus/") > | | | 4 -> (tramp-file-name-handler file-name-as-directory "/plinkx:detlefx:/home/albinus/") > | | | 4 <- tramp-file-name-handler: "/plinkx:detlefx:/home/albinus/" > | | | 4 -> (expand-file-name "/home/albinus/tmp/") > | | | 4 <- expand-file-name: "c:/home/albinus/tmp/" > | | 3 <- tramp-sh-handle-expand-file-name: "/plinkx:detlefx:/home/albinus/tmp/" > | 2 <- tramp-file-name-handler: "/plinkx:detlefx:/home/albinus/tmp/" > 1 <- expand-file-name: "c:/plinkx:detlefx:/home/albinus/tmp/123" > ====================================================================== > > The buffer's default-directory is remote, "/plinkx:detlefx:/home/albinus/". > expand-file-name is called > > --8<---------------cut here---------------start------------->8--- > (expand-file-name "123" "tmp/") > --8<---------------cut here---------------end--------------->8--- > > This is entry "1" in the trace output. In function Fexpand_file_name, > line 794 of fileio.c, there is the check > > --8<---------------cut here---------------start------------->8--- > handler = Ffind_file_name_handler (name, Qexpand_file_name); > --8<---------------cut here---------------end--------------->8--- > > This returns Qnil, because name is "123". Then we have in line 823 > > --8<---------------cut here---------------start------------->8--- > handler = Ffind_file_name_handler (default_directory, Qexpand_file_name); > --8<---------------cut here---------------end--------------->8--- > > This returns Qnil again, because default_directory is "tmp/". That's all > about checking for a file name handler. Later on, line 872, there is > > --8<---------------cut here---------------start------------->8--- > default_directory = Fexpand_file_name (default_directory, Qnil); > --8<---------------cut here---------------end--------------->8--- > > which belongs to entry "2" of the traces above. It returns the proper > answer "/plinkx:detlefx:/home/albinus/tmp/". But this is too late; it > must happen before the second call of Ffind_file_name_handler. > Fexpand_file_name continues to work, it constructs the final answer > "/plinkx:detlefx:/home/albinus/tmp/123" *plus* the drive letter (I > suppose line 1047), Could you please elaborate on the "this is too late" part? What exactly should have happened "before the second call of Ffind_file_name_handler", and how would that help to fix this problem, in your opinion? I'm asking because the straightforward way of fixing this seems to notice that the buffer's default-directory is remote, and refrain from adding the drive letter in that case. However, your comments above seem to hint that another, perhaps simpler and/or more elegant, way should be possible, and I wonder what could that other way be. TIA