+2011-02-02 Eli Zaretskii <eliz@gnu.org>
+
+ * dired.el (dired-insert-directory): Don't invoke `ls' when
+ ls-lisp.el is used to emulate it.
+
2011-02-01 Julien Danjou <julien@danjou.info>
* color.el (color-gradient): Add a color-gradient function.
(set-marker file nil)))))
+(defvar ls-lisp-use-insert-directory-program)
+
(defun dired-insert-directory (dir switches &optional file-list wildcard hdr)
"Insert a directory listing of DIR, Dired style.
Use SWITCHES to make the listings.
(let ((opoint (point))
(process-environment (copy-sequence process-environment))
end)
- (if (or (if (eq dired-use-ls-dired 'unspecified)
- ;; Check whether "ls --dired" gives exit code 0, and
- ;; save the answer in `dired-use-ls-dired'.
- (setq dired-use-ls-dired
- (eq (call-process insert-directory-program nil nil nil "--dired")
- 0))
- dired-use-ls-dired)
- (file-remote-p dir))
+ (if (and
+ ;; Don't try to invoke `ls' if we are on DOS/Windows where
+ ;; ls-lisp emulation is used, except if they want to use `ls'
+ ;; as indicated by `ls-lisp-use-insert-directory-program'.
+ (not (and (featurep 'ls-lisp)
+ (null ls-lisp-use-insert-directory-program)))
+ (or (if (eq dired-use-ls-dired 'unspecified)
+ ;; Check whether "ls --dired" gives exit code 0, and
+ ;; save the answer in `dired-use-ls-dired'.
+ (setq dired-use-ls-dired
+ (eq (call-process insert-directory-program nil nil nil "--dired")
+ 0))
+ dired-use-ls-dired)
+ (file-remote-p dir)))
(setq switches (concat "--dired " switches)))
;; We used to specify the C locale here, to force English month names;
;; but this should not be necessary any more,