Subject: Re: bug#65685: 29.1; Inconsistent behavior of quoted file name "/:~" across platforms

From: Michael Albinus <[email-masked]>
Date: Sat, 14 Oct 2023 18:48:16 +0200

Michael Albinus <[email-masked]> writes:

Hi Eli,

>> The only difference I could think of is that the directory Emacs uses
>> here has whitespace in its name (see my original report), whereas on
>> Windows 10 it probably doesn't.
>
> FTR, if I use a directory with spaces in its name, it fails for me as
> well. I'm now debugging ...

It looks, like it is a problem in the test case code
itself. abbreviate-file-name does not work as I expect in this
combination.

Well, since it isn't needed for the test, the appended patch has fixed
it for me. Would you like to check?

Best regards, Michael.

diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 8f6495a293c..07e1be015da 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -668,12 +668,14 @@ files-tests-file-name-non-special-expand-file-name-tilde
         abbreviated-home-dir)
     (files-tests--with-temp-non-special (tmpfile nospecial)
       (let (file-name-handler-alist)
-        (setq nospecial (file-name-quote (abbreviate-file-name tmpfile))))
+        (setq nospecial
+              (file-name-quote (concat "~/" (file-name-nondirectory tmpfile)))))
       (should (equal (expand-file-name nospecial)
                      (expand-file-name (file-name-unquote nospecial t)))))
     (files-tests--with-temp-non-special-and-file-name-handler (tmpfile nospecial)
       (let (file-name-handler-alist)
-        (setq nospecial (file-name-quote (abbreviate-file-name tmpfile))))
+        (setq nospecial
+              (file-name-quote (concat "~/" (file-name-nondirectory tmpfile)))))
       (should-not
        (equal (expand-file-name nospecial)
               ;; The file name handler deletes the ".special" extension.