From 5a8a160eb6c1f4355b6290b3585ed83fad2b7aa2 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 28 Jan 1996 19:27:44 +0000 Subject: [PATCH] (list-directory): Set default-directory better if the argument is a directory's file name. --- lisp/files.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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))))))) -- 2.39.2