]> git.eshelyaron.com Git - emacs.git/commitdiff
Make ls-lisp.el behave like Posix hosts when directory doesn't exist
authorEli Zaretskii <eliz@gnu.org>
Fri, 15 Feb 2019 13:45:23 +0000 (15:45 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 15 Feb 2019 13:45:23 +0000 (15:45 +0200)
* lisp/ls-lisp.el (ls-lisp-insert-directory): For a directory
that cannot be accessed, signal an error, like insert-directory
does on Posix systems.  This causes files-tests.el to pass on
MS-Windows.

lisp/ls-lisp.el

index c00dd29c4545c6597d6a25525bb5d2682113a576..1f2c46834ecd0580141c08507233699f15ea9b93 100644 (file)
@@ -475,9 +475,13 @@ not contain `d', so that a full listing is expected."
                       (ls-lisp-classify-file file fattr)
                     file)
                   fattr (file-attribute-size fattr)
-                                 switches time-index))
-       (message "%s: doesn't exist or is inaccessible" file)
-       (ding) (sit-for 2)))))          ; to show user the message!
+                   switches time-index))
+        ;; Emulate what we do on Posix hosts when we call access-file
+        ;; in insert-directory.
+       (signal 'file-error
+                (list "Reading directory"
+                      "Directory doesn't exist or is inaccessible"
+                      file))))))
 
 (declare-function dired-read-dir-and-switches "dired" (str))
 (declare-function dired-goto-next-file "dired" ())