]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/files.el (insert-directory): Simplify (if ... X X) to X.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 26 Aug 2020 17:51:48 +0000 (10:51 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 26 Aug 2020 20:27:56 +0000 (13:27 -0700)
lisp/files.el

index e08f0f0134c6f144d956b9aaa201226e7face30b..3403e257a16b809e65f1f8295a6632ca49daa555 100644 (file)
@@ -7070,6 +7070,8 @@ normally equivalent short `-D' option is just passed on to
                              ((stringp switches) (concat switches " -d"))
                              ((member "-d" switches) switches)
                              (t (append switches '("-d"))))))
+                   (if (string-match "\\`~" file)
+                       (setq file (expand-file-name file)))
                    (apply 'call-process
                           insert-directory-program nil t nil
                           (append
@@ -7080,14 +7082,7 @@ normally equivalent short `-D' option is just passed on to
                                (split-string-and-unquote switches)))
                            ;; Avoid lossage if FILE starts with `-'.
                            '("--")
-                           (progn
-                             (if (string-match "\\`~" file)
-                                 (setq file (expand-file-name file)))
-                             (list
-                              (if full-directory-p
-                                  ;; (concat (file-name-as-directory file) ".")
-                                   file
-                                file))))))))
+                           (list file))))))
 
          ;; If we got "//DIRED//" in the output, it means we got a real
          ;; directory listing, even if `ls' returned nonzero.