aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2017-07-30 13:11:00 +0200
committerMichael Albinus2017-07-30 13:11:00 +0200
commit6c106712a8d2ffd0c932541cb50cc59a6df732f4 (patch)
tree0c1c0f3a7529653ceef02d344d542c222c4471e6
parent65d428228bb57ce434a8eb5a4eeb2274171586b8 (diff)
downloademacs-6c106712a8d2ffd0c932541cb50cc59a6df732f4.tar.gz
emacs-6c106712a8d2ffd0c932541cb50cc59a6df732f4.zip
* lisp/dired.el (dired-insert-directory): Move `file-remote-p' check up.
-rw-r--r--lisp/dired.el26
1 files changed, 16 insertions, 10 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index e09691b07c6..a056ad679fa 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1209,19 +1209,20 @@ If HDR is non-nil, insert a header line with the directory name."
1209 ;; as indicated by `ls-lisp-use-insert-directory-program'. 1209 ;; as indicated by `ls-lisp-use-insert-directory-program'.
1210 (not (and (featurep 'ls-lisp) 1210 (not (and (featurep 'ls-lisp)
1211 (null ls-lisp-use-insert-directory-program))) 1211 (null ls-lisp-use-insert-directory-program)))
1212 (not (and (featurep 'eshell) (bound-and-true-p eshell-ls-use-in-dired))) 1212 (not (and (featurep 'eshell)
1213 (or (if (eq dired-use-ls-dired 'unspecified) 1213 (bound-and-true-p eshell-ls-use-in-dired)))
1214 (or (file-remote-p dir)
1215 (if (eq dired-use-ls-dired 'unspecified)
1214 ;; Check whether "ls --dired" gives exit code 0, and 1216 ;; Check whether "ls --dired" gives exit code 0, and
1215 ;; save the answer in `dired-use-ls-dired'. 1217 ;; save the answer in `dired-use-ls-dired'.
1216 (or (setq dired-use-ls-dired 1218 (or (setq dired-use-ls-dired
1217 (eq 0 (call-process insert-directory-program 1219 (eq 0 (call-process insert-directory-program
1218 nil nil nil "--dired"))) 1220 nil nil nil "--dired")))
1219 (progn 1221 (progn
1220 (message "ls does not support --dired; \ 1222 (message "ls does not support --dired; \
1221see `dired-use-ls-dired' for more details.") 1223see `dired-use-ls-dired' for more details.")
1222 nil)) 1224 nil))
1223 dired-use-ls-dired) 1225 dired-use-ls-dired)))
1224 (file-remote-p dir)))
1225 (setq switches (concat "--dired " switches))) 1226 (setq switches (concat "--dired " switches)))
1226 ;; Expand directory wildcards and fill file-list. 1227 ;; Expand directory wildcards and fill file-list.
1227 (let ((dir-wildcard (insert-directory-wildcard-in-dir-p dir))) 1228 (let ((dir-wildcard (insert-directory-wildcard-in-dir-p dir)))
@@ -1229,13 +1230,18 @@ see `dired-use-ls-dired' for more details.")
1229 (setq switches (concat "-d " switches)) 1230 (setq switches (concat "-d " switches))
1230 (let ((default-directory (car dir-wildcard)) 1231 (let ((default-directory (car dir-wildcard))
1231 (script (format "ls %s %s" switches (cdr dir-wildcard)))) 1232 (script (format "ls %s %s" switches (cdr dir-wildcard))))
1232 (unless (zerop (process-file "/bin/sh" nil (current-buffer) nil "-c" script)) 1233 (unless
1233 (user-error "%s: No files matching wildcard" (cdr dir-wildcard))) 1234 (zerop
1235 (process-file
1236 "/bin/sh" nil (current-buffer) nil "-c" script))
1237 (user-error
1238 "%s: No files matching wildcard" (cdr dir-wildcard)))
1234 (insert-directory-clean (point) switches))) 1239 (insert-directory-clean (point) switches)))
1235 (t 1240 (t
1236 ;; We used to specify the C locale here, to force English month names; 1241 ;; We used to specify the C locale here, to force English
1237 ;; but this should not be necessary any more, 1242 ;; month names; but this should not be necessary any
1238 ;; with the new value of `directory-listing-before-filename-regexp'. 1243 ;; more, with the new value of
1244 ;; `directory-listing-before-filename-regexp'.
1239 (if file-list 1245 (if file-list
1240 (dolist (f file-list) 1246 (dolist (f file-list)
1241 (let ((beg (point))) 1247 (let ((beg (point)))