aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-04-13 04:26:38 +0000
committerRichard M. Stallman1997-04-13 04:26:38 +0000
commit54df7d9acc589ee268930b1cd1cad92d90c8a1b4 (patch)
treec99fce27377d51cedc091fab51baf3428c17a3d9
parentded3e3d8164880c92301010fce1426ae20fb8d12 (diff)
downloademacs-54df7d9acc589ee268930b1cd1cad92d90c8a1b4.tar.gz
emacs-54df7d9acc589ee268930b1cd1cad92d90c8a1b4.zip
(dired-noselect): Avoid calling file-directory-p
when the initial argument was syntactically a directory name.
-rw-r--r--lisp/dired.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 470a970dd28..3792af9727a 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -410,16 +410,24 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
410 (or dir-or-list (setq dir-or-list default-directory)) 410 (or dir-or-list (setq dir-or-list default-directory))
411 ;; This loses the distinction between "/foo/*/" and "/foo/*" that 411 ;; This loses the distinction between "/foo/*/" and "/foo/*" that
412 ;; some shells make: 412 ;; some shells make:
413 (let (dirname) 413 (let (dirname initially-was-dirname)
414 (if (consp dir-or-list) 414 (if (consp dir-or-list)
415 (setq dirname (car dir-or-list)) 415 (setq dirname (car dir-or-list))
416 (setq dirname dir-or-list)) 416 (setq dirname dir-or-list))
417 (setq initially-was-dirname
418 (string= (file-name-as-directory dirname) dirname))
417 (setq dirname (abbreviate-file-name 419 (setq dirname (abbreviate-file-name
418 (expand-file-name (directory-file-name dirname)))) 420 (expand-file-name (directory-file-name dirname))))
419 (if find-file-visit-truename 421 (if find-file-visit-truename
420 (setq dirname (file-truename dirname))) 422 (setq dirname (file-truename dirname)))
421 (if (file-directory-p dirname) 423 ;; If the argument was syntactically a directory name not a file name,
422 (setq dirname (file-name-as-directory dirname))) 424 ;; or if it happens to name a file that is a directory,
425 ;; convert it syntactically to a directory name.
426 ;; The reason for checking initially-was-dirname
427 ;; and not just file-directory-p
428 ;; is that file-directory-p is slow over ftp.
429 (if (or initially-was-dirname (file-directory-p dirname))
430 (setq dirname (file-name-as-directory dirname)))
423 (if (consp dir-or-list) 431 (if (consp dir-or-list)
424 (setq dir-or-list (cons dirname (cdr dir-or-list))) 432 (setq dir-or-list (cons dirname (cdr dir-or-list)))
425 (setq dir-or-list dirname)) 433 (setq dir-or-list dirname))