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

From: Paul Eggert <[email-masked]>
Date: Sat, 29 Aug 2020 13:42:23 -0700

On 8/29/20 11:26 AM, Eli Zaretskii wrote:

>> That's what Emacs 27 does on MS-Windows, no? So it's not a regression, and the
>> problem can be fixed at the convenience of whoever's interested in hacking on
>> the MS-Windows side of the code.
> 
> It's a regression wrt behavior on Posix platforms: it fails one of the
> tests in fileio-tests.el:

That's not a regression in the usual sense of the word, since Emacs master on 
MS-Windows is behaving the same way it did in Emacs 27. It's merely a bug that 
has been fixed on most platforms but not on MS-Windows.

The test you mentioned is newly-added and already special-cases for MS-Windows, 
and it's easy to special-case it just a bit more. I installed the attached 
little patch as a workaround until we can get the bug fixed in the MS-Windows 
support code.

> If that is the case, I prefer that we revert all the changes made
> recently to fix bug#26911, and leave that bug open, until a fix is
> available that works on all platforms.

Although we should continue to leave the bug open (since it's still present on 
MS-Windows), reverting would be the tail wagging the dog. We should not 
reintroduce a bug on GNU and similar platforms merely because we haven't yet 
found the time to fix the bug on MS-Windows.

It surely would be better to fix the bug on MS-Windows. A good way to start 
doing that is to refactor the code a bit to avoid the tricky #ifdefs it 
currently uses, as these #ifdefs make bugs like this painful to fix. I can draft 
a patch along those lines if you like. I realize you're dubious about 
refactoring and so wouldn't install the patch without checking with you.

If you prefer fixing it a different way of course feel free to suggest 
something. Since I don't use MS-Windows your expertise would be helpful.
>From e709c187fde76573ea3ec3a5f14e09b9ed59525f Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Sat, 29 Aug 2020 13:34:06 -0700
Subject: [PATCH] Mark failing fileio test on MS-Windows

* test/src/fileio-tests.el (fileio-tests--HOME-trailing-slash):
Expect failure on MS-Windows.
---
 test/src/fileio-tests.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el
index 7baa4c7e2f..bedda83bbd 100644
--- a/test/src/fileio-tests.el
+++ b/test/src/fileio-tests.el
@@ -109,6 +109,9 @@ fileio-tests--relative-HOME
 
 (ert-deftest fileio-tests--HOME-trailing-slash ()
   "Test that expand-file-name of \"~\" respects trailing slash."
+  :expected-result (if (memq system-type '(windows-nt ms-dos))
+                       :failed
+                     :passed)
   (let ((process-environment (copy-sequence process-environment)))
     (dolist (home
              (if (memq system-type '(windows-nt ms-dos))
-- 
2.17.1