Subject: Re: bug#26911: 25.2; eshell "cd .." doesn't work correctly with TRAMP

From: Eli Zaretskii <[email-masked]>
Date: Sat, 29 Aug 2020 09:31:22 +0300

> Cc: [email-masked], [email-masked], [email-masked],
>  [email-masked]
> From: Paul Eggert <[email-masked]>
> Date: Fri, 28 Aug 2020 22:52:28 -0700
> 
> > That period after the colon following the drive letter shouldn't be
> > there.  As you may imagine, many Emacs commands are now broken because
> > of this.  This must be fixed ASAP.
> 
> I installed the attached patch to revert the recent expand-file-changes in the 
> DOS_NT case, which should fix the problem you mentioned.

Thanks, it does.  But it produces a different problem:

  (expand-file-name "." "c:/foo/bar/") => "c:/foo/bar

(note the absence of the trailing slash).

> This part of fileio.c is hard to follow because of the #ifdef DOS_NT and #ifdef 
> WINDOWSNT and #ifdef MSDOS and whatnot. How about if we move the 
> MS-Windows-specific code to a different source file instead of having that 
> forest of ifdefs in fileio.c? As things stand, it's hard to maintain the 
> mainline GNU code, because the way everything's arranged the Microsoft-specific 
> stuff significantly obfuscates everything else.

Sorry, I'm not interested in messing with expand-file-name, as the
gains are insignificant, if there are any, and the potential problems
that could cause are a legion.  I actually think that your latest set
of changes there was a mistake (for the same reasons), but as long as
you are prepared to fix the fallout, I won't actively object.

It took us a lot of blood, sweat, and tears to get to the point where
we are: that expand-file-name works correctly for all supported
systems (including DOS/Windows) and also the remote use case.  We all
know how one of the gazillion use cases of that function can be easily
broken by a seemingly innocent change in its complex code.  So I think
we should leave that function alone, and any problems with file names
(if they indeed are significant) should be fixed elsewhere.