From: Richard M. Stallman Date: Sun, 28 Jan 1996 19:27:44 +0000 (+0000) Subject: (list-directory): Set default-directory better if the X-Git-Tag: emacs-19.34~1459 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5a8a160eb6c1f4355b6290b3585ed83fad2b7aa2;p=emacs.git (list-directory): Set default-directory better if the argument is a directory's file name. --- diff --git a/lisp/files.el b/lisp/files.el index 197a5624900..0afa0fe170a 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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)))))))