diff options
| author | Glenn Morris | 2011-07-13 13:34:31 -0400 |
|---|---|---|
| committer | Glenn Morris | 2011-07-13 13:34:31 -0400 |
| commit | 6240145a7f5a355575a5ca3206e89c3baba95b3c (patch) | |
| tree | 5e6f938a9f90e83b0566e2cb54e914f811cf3e7a | |
| parent | c75883645245f01232b98b72e3b417a1fd3c6569 (diff) | |
| download | emacs-6240145a7f5a355575a5ca3206e89c3baba95b3c.tar.gz emacs-6240145a7f5a355575a5ca3206e89c3baba95b3c.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/dired.el | 26 |
2 files changed, 27 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c5eb9f94e53..22f5d304f6f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-07-13 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * dired.el (dired-use-ls-dired): Doc fix. (Bug#9039). | ||
| 4 | (dired-insert-directory): Give a message the first time | ||
| 5 | if ls is found not to support --dired. | ||
| 6 | |||
| 1 | 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org> | 7 | 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 8 | ||
| 3 | * simple.el (toggle-truncate-lines): Clarify what is toggled | 9 | * simple.el (toggle-truncate-lines): Clarify what is toggled |
diff --git a/lisp/dired.el b/lisp/dired.el index 96709ffecd8..3606e3df335 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -78,10 +78,22 @@ If nil, `dired-listing-switches' is used." | |||
| 78 | :type 'file) | 78 | :type 'file) |
| 79 | 79 | ||
| 80 | (defcustom dired-use-ls-dired 'unspecified | 80 | (defcustom dired-use-ls-dired 'unspecified |
| 81 | "Non-nil means Dired should use \"ls --dired\". | 81 | "Non-nil means Dired should pass the \"--dired\" option to \"ls\". |
| 82 | The special value of `unspecified' means to check explicitly, and | 82 | The special value of `unspecified' means to check explicitly, and |
| 83 | save the result in this variable. This is performed the first | 83 | save the result in this variable. This is performed the first |
| 84 | time `dired-insert-directory' is called." | 84 | time `dired-insert-directory' is called. |
| 85 | |||
| 86 | Note that if you set this option to nil, either through choice or | ||
| 87 | because your \"ls\" program does not support \"--dired\", Dired | ||
| 88 | will fail to parse some \"unusual\" file names, e.g. those with leading | ||
| 89 | spaces. You might want to install ls from GNU Coreutils, which does | ||
| 90 | support this option. Alternatively, you might want to use Emacs's | ||
| 91 | own emulation of \"ls\", by using: | ||
| 92 | \(setq ls-lisp-use-insert-directory-program nil) | ||
| 93 | \(require 'ls-lisp) | ||
| 94 | This is used by default on MS Windows, which does not have an \"ls\" program. | ||
| 95 | Note that `ls-lisp' does not support as many options as GNU ls, though. | ||
| 96 | For more details, see Info node `(emacs)ls in Lisp'." | ||
| 85 | :group 'dired | 97 | :group 'dired |
| 86 | :type '(choice (const :tag "Check for --dired support" unspecified) | 98 | :type '(choice (const :tag "Check for --dired support" unspecified) |
| 87 | (const :tag "Do not use --dired" nil) | 99 | (const :tag "Do not use --dired" nil) |
| @@ -1119,9 +1131,13 @@ If HDR is non-nil, insert a header line with the directory name." | |||
| 1119 | (or (if (eq dired-use-ls-dired 'unspecified) | 1131 | (or (if (eq dired-use-ls-dired 'unspecified) |
| 1120 | ;; Check whether "ls --dired" gives exit code 0, and | 1132 | ;; Check whether "ls --dired" gives exit code 0, and |
| 1121 | ;; save the answer in `dired-use-ls-dired'. | 1133 | ;; save the answer in `dired-use-ls-dired'. |
| 1122 | (setq dired-use-ls-dired | 1134 | (or (setq dired-use-ls-dired |
| 1123 | (eq (call-process insert-directory-program nil nil nil "--dired") | 1135 | (eq 0 (call-process insert-directory-program |
| 1124 | 0)) | 1136 | nil nil nil "--dired"))) |
| 1137 | (progn | ||
| 1138 | (message "ls does not support --dired; \ | ||
| 1139 | see `dired-use-ls-dired' for more details.") | ||
| 1140 | nil)) | ||
| 1125 | dired-use-ls-dired) | 1141 | dired-use-ls-dired) |
| 1126 | (file-remote-p dir))) | 1142 | (file-remote-p dir))) |
| 1127 | (setq switches (concat "--dired " switches))) | 1143 | (setq switches (concat "--dired " switches))) |