]> git.eshelyaron.com Git - emacs.git/commitdiff
(list-directory): Set default-directory better if the
authorRichard M. Stallman <rms@gnu.org>
Sun, 28 Jan 1996 19:27:44 +0000 (19:27 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 28 Jan 1996 19:27:44 +0000 (19:27 +0000)
argument is a directory's file name.

lisp/files.el

index 197a56249006f8955709749e5cfa0f7c79b04574..0afa0fe170a1e775cb4762db1a5e0db7f75b427c 100644 (file)
@@ -2536,7 +2536,10 @@ and `list-directory-verbose-switches'."
       (terpri)
       (save-excursion
        (set-buffer "*Directory*")
-       (setq default-directory (file-name-directory dirname))
+       (setq default-directory
+             (if (file-directory-p dirname)
+                 (file-name-as-directory dirname)
+               (file-name-directory dirname)))
        (let ((wildcard (not (file-directory-p dirname))))
          (insert-directory dirname switches wildcard (not wildcard)))))))