Commit 6240145a authored by Glenn Morris's avatar Glenn Morris
Browse files

Small dired fixes related to bug#9039.

* lisp/dired.el (dired-use-ls-dired): Doc fix.
(dired-insert-directory): Give a message the first time
if ls is found not to support --dired.
parent c7588364
2011-07-13 Glenn Morris <>
* dired.el (dired-use-ls-dired): Doc fix. (Bug#9039).
(dired-insert-directory): Give a message the first time
if ls is found not to support --dired.
2011-07-13 Lars Magne Ingebrigtsen <>
* simple.el (toggle-truncate-lines): Clarify what is toggled
......@@ -78,10 +78,22 @@ If nil, `dired-listing-switches' is used."
:type 'file)
(defcustom dired-use-ls-dired 'unspecified
"Non-nil means Dired should use \"ls --dired\".
"Non-nil means Dired should pass the \"--dired\" option to \"ls\".
The special value of `unspecified' means to check explicitly, and
save the result in this variable. This is performed the first
time `dired-insert-directory' is called."
time `dired-insert-directory' is called.
Note that if you set this option to nil, either through choice or
because your \"ls\" program does not support \"--dired\", Dired
will fail to parse some \"unusual\" file names, e.g. those with leading
spaces. You might want to install ls from GNU Coreutils, which does
support this option. Alternatively, you might want to use Emacs's
own emulation of \"ls\", by using:
\(setq ls-lisp-use-insert-directory-program nil)
\(require 'ls-lisp)
This is used by default on MS Windows, which does not have an \"ls\" program.
Note that `ls-lisp' does not support as many options as GNU ls, though.
For more details, see Info node `(emacs)ls in Lisp'."
:group 'dired
:type '(choice (const :tag "Check for --dired support" unspecified)
(const :tag "Do not use --dired" nil)
......@@ -1119,9 +1131,13 @@ If HDR is non-nil, insert a header line with the directory name."
(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")
(or (setq dired-use-ls-dired
(eq 0 (call-process insert-directory-program
nil nil nil "--dired")))
(message "ls does not support --dired; \
see `dired-use-ls-dired' for more details.")
(file-remote-p dir)))
(setq switches (concat "--dired " switches)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment