diff options
| author | Eli Zaretskii | 2011-02-02 18:21:52 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2011-02-02 18:21:52 +0200 |
| commit | bc35ff325b150d01e6858358e625dcdb6374fb37 (patch) | |
| tree | c0f53571c03b82b90a803a04401c0db73b786189 | |
| parent | aa2d499cd626a2e2f6e131cbbf8127c34c77a8d9 (diff) | |
| download | emacs-bc35ff325b150d01e6858358e625dcdb6374fb37.tar.gz emacs-bc35ff325b150d01e6858358e625dcdb6374fb37.zip | |
Fix Dired on DOS/Windows.
dired.el (dired-insert-directory): Don't invoke `ls' when
ls-lisp.el is used to emulate it.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/dired.el | 24 |
2 files changed, 21 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 627c61deaeb..219aef943de 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-02-02 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * dired.el (dired-insert-directory): Don't invoke `ls' when | ||
| 4 | ls-lisp.el is used to emulate it. | ||
| 5 | |||
| 1 | 2011-02-01 Julien Danjou <julien@danjou.info> | 6 | 2011-02-01 Julien Danjou <julien@danjou.info> |
| 2 | 7 | ||
| 3 | * color.el (color-gradient): Add a color-gradient function. | 8 | * color.el (color-gradient): Add a color-gradient function. |
diff --git a/lisp/dired.el b/lisp/dired.el index 3cc490f12c7..3a76398e956 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -1052,6 +1052,8 @@ BEG..END is the line where the file info is located." | |||
| 1052 | (set-marker file nil))))) | 1052 | (set-marker file nil))))) |
| 1053 | 1053 | ||
| 1054 | 1054 | ||
| 1055 | (defvar ls-lisp-use-insert-directory-program) | ||
| 1056 | |||
| 1055 | (defun dired-insert-directory (dir switches &optional file-list wildcard hdr) | 1057 | (defun dired-insert-directory (dir switches &optional file-list wildcard hdr) |
| 1056 | "Insert a directory listing of DIR, Dired style. | 1058 | "Insert a directory listing of DIR, Dired style. |
| 1057 | Use SWITCHES to make the listings. | 1059 | Use SWITCHES to make the listings. |
| @@ -1063,14 +1065,20 @@ If HDR is non-nil, insert a header line with the directory name." | |||
| 1063 | (let ((opoint (point)) | 1065 | (let ((opoint (point)) |
| 1064 | (process-environment (copy-sequence process-environment)) | 1066 | (process-environment (copy-sequence process-environment)) |
| 1065 | end) | 1067 | end) |
| 1066 | (if (or (if (eq dired-use-ls-dired 'unspecified) | 1068 | (if (and |
| 1067 | ;; Check whether "ls --dired" gives exit code 0, and | 1069 | ;; Don't try to invoke `ls' if we are on DOS/Windows where |
| 1068 | ;; save the answer in `dired-use-ls-dired'. | 1070 | ;; ls-lisp emulation is used, except if they want to use `ls' |
| 1069 | (setq dired-use-ls-dired | 1071 | ;; as indicated by `ls-lisp-use-insert-directory-program'. |
| 1070 | (eq (call-process insert-directory-program nil nil nil "--dired") | 1072 | (not (and (featurep 'ls-lisp) |
| 1071 | 0)) | 1073 | (null ls-lisp-use-insert-directory-program))) |
| 1072 | dired-use-ls-dired) | 1074 | (or (if (eq dired-use-ls-dired 'unspecified) |
| 1073 | (file-remote-p dir)) | 1075 | ;; Check whether "ls --dired" gives exit code 0, and |
| 1076 | ;; save the answer in `dired-use-ls-dired'. | ||
| 1077 | (setq dired-use-ls-dired | ||
| 1078 | (eq (call-process insert-directory-program nil nil nil "--dired") | ||
| 1079 | 0)) | ||
| 1080 | dired-use-ls-dired) | ||
| 1081 | (file-remote-p dir))) | ||
| 1074 | (setq switches (concat "--dired " switches))) | 1082 | (setq switches (concat "--dired " switches))) |
| 1075 | ;; We used to specify the C locale here, to force English month names; | 1083 | ;; We used to specify the C locale here, to force English month names; |
| 1076 | ;; but this should not be necessary any more, | 1084 | ;; but this should not be necessary any more, |