]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/dired.el (dired-noselect): Simplify
authorEshel Yaron <me@eshelyaron.com>
Tue, 4 Jun 2024 20:26:36 +0000 (22:26 +0200)
committerEshel Yaron <me@eshelyaron.com>
Tue, 4 Jun 2024 20:26:36 +0000 (22:26 +0200)
lisp/dired.el

index f5dd96c3ef96fd9550a718e5ce2664dddc444789..74ddfa9b775e6895bfcc0eeba9af14877adc65ce 100644 (file)
@@ -1209,16 +1209,12 @@ If DIRNAME is already in a Dired buffer, that buffer is used without refresh."
   (or dir-or-list (setq dir-or-list default-directory))
   ;; This loses the distinction between "/foo/*/" and "/foo/*" that
   ;; some shells make:
-  (let (dirname initially-was-dirname)
-    (if (consp dir-or-list)
-       (setq dirname (car dir-or-list))
-      (setq dirname dir-or-list))
-    (setq initially-was-dirname
-         (string= (file-name-as-directory dirname) dirname))
-    (setq dirname (abbreviate-file-name
-                  (expand-file-name (directory-file-name dirname))))
-    (if find-file-visit-truename
-       (setq dirname (file-truename dirname)))
+  (let* ((initial (car (ensure-list dir-or-list)))
+         (initially-was-dirname (string= (file-name-as-directory initial)
+                                         initial))
+         (dirname (abbreviate-file-name
+                  (expand-file-name (directory-file-name initial)))))
+    (when find-file-visit-truename (setq dirname (file-truename dirname)))
     ;; If the argument was syntactically  a directory name not a file name,
     ;; or if it happens to name a file that is a directory,
     ;; convert it syntactically to a directory name.