emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105170: Small dired fixes related to


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105170: Small dired fixes related to bug#9039.
Date: Wed, 13 Jul 2011 13:34:31 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105170
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2011-07-13 13:34:31 -0400
message:
  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.
modified:
  lisp/ChangeLog
  lisp/dired.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-07-13 16:39:49 +0000
+++ b/lisp/ChangeLog    2011-07-13 17:34:31 +0000
@@ -1,3 +1,9 @@
+2011-07-13  Glenn Morris  <address@hidden>
+
+       * 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  <address@hidden>
 
        * simple.el (toggle-truncate-lines): Clarify what is toggled

=== modified file 'lisp/dired.el'
--- a/lisp/dired.el     2011-07-13 15:15:26 +0000
+++ b/lisp/dired.el     2011-07-13 17:34:31 +0000
@@ -78,10 +78,22 @@
   :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 @@
         (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))
+                (or (setq dired-use-ls-dired
+                          (eq 0 (call-process insert-directory-program
+                                            nil nil nil "--dired")))
+                    (progn
+                      (message "ls does not support --dired; \
+see `dired-use-ls-dired' for more details.")
+                      nil))
               dired-use-ls-dired)
             (file-remote-p dir)))
        (setq switches (concat "--dired " switches)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]