Mercurial > emacs
comparison lisp/find-dired.el @ 55940:793fa6e18e9d
(find-ls-subdir-switches): New user option.
(find-dired): No longer call `abbreviate-file-name' on DIR.
Set `dired-subdir-switches' buffer-locally.
author | Luc Teirlinck <teirllm@auburn.edu> |
---|---|
date | Sun, 06 Jun 2004 02:30:21 +0000 |
parents | 0b81a282eca3 |
children | aac0a33f5772 4c90ffeb71c5 |
comparison
equal
deleted
inserted
replaced
55939:fb2c1d5537f3 | 55940:793fa6e18e9d |
---|---|
53 :type '(cons (string :tag "Find Option") | 53 :type '(cons (string :tag "Find Option") |
54 (string :tag "Ls Switches")) | 54 (string :tag "Ls Switches")) |
55 :group 'find-dired) | 55 :group 'find-dired) |
56 | 56 |
57 ;;;###autoload | 57 ;;;###autoload |
58 (defcustom find-ls-subdir-switches "-al" | |
59 "`ls' switches for inserting subdirectories in `*Find*' buffers. | |
60 This should contain the \"-l\" switch. | |
61 Use the \"-F\" or \"-b\" switches if and only if you also use | |
62 them for `find-ls-option'." | |
63 :type 'string | |
64 :group 'find-dired | |
65 :version "21.4") | |
66 | |
67 ;;;###autoload | |
58 (defcustom find-grep-options | 68 (defcustom find-grep-options |
59 (if (or (eq system-type 'berkeley-unix) | 69 (if (or (eq system-type 'berkeley-unix) |
60 (string-match "solaris2" system-configuration) | 70 (string-match "solaris2" system-configuration) |
61 (string-match "irix" system-configuration)) | 71 (string-match "irix" system-configuration)) |
62 "-s" "-q") | 72 "-s" "-q") |
87 (read-string "Run find (with args): " find-args | 97 (read-string "Run find (with args): " find-args |
88 '(find-args-history . 1)))) | 98 '(find-args-history . 1)))) |
89 (let ((dired-buffers dired-buffers)) | 99 (let ((dired-buffers dired-buffers)) |
90 ;; Expand DIR ("" means default-directory), and make sure it has a | 100 ;; Expand DIR ("" means default-directory), and make sure it has a |
91 ;; trailing slash. | 101 ;; trailing slash. |
92 (setq dir (abbreviate-file-name | 102 (setq dir (file-name-as-directory (expand-file-name dir))) |
93 (file-name-as-directory (expand-file-name dir)))) | |
94 ;; Check that it's really a directory. | 103 ;; Check that it's really a directory. |
95 (or (file-directory-p dir) | 104 (or (file-directory-p dir) |
96 (error "find-dired needs a directory: %s" dir)) | 105 (error "find-dired needs a directory: %s" dir)) |
97 (switch-to-buffer (get-buffer-create "*Find*")) | 106 (switch-to-buffer (get-buffer-create "*Find*")) |
98 | 107 |
113 (widen) | 122 (widen) |
114 (kill-all-local-variables) | 123 (kill-all-local-variables) |
115 (setq buffer-read-only nil) | 124 (setq buffer-read-only nil) |
116 (erase-buffer) | 125 (erase-buffer) |
117 (setq default-directory dir | 126 (setq default-directory dir |
118 find-args args ; save for next interactive call | 127 find-args args ; save for next interactive call |
119 args (concat find-dired-find-program " . " | 128 args (concat find-dired-find-program " . " |
120 (if (string= args "") | 129 (if (string= args "") |
121 "" | 130 "" |
122 (concat "\\( " args " \\) ")) | 131 (concat "\\( " args " \\) ")) |
123 (car find-ls-option))) | 132 (car find-ls-option))) |
141 (dired-simple-subdir-alist) | 150 (dired-simple-subdir-alist) |
142 ;; else we have an ancient tree dired (or classic dired, where | 151 ;; else we have an ancient tree dired (or classic dired, where |
143 ;; this does no harm) | 152 ;; this does no harm) |
144 (set (make-local-variable 'dired-subdir-alist) | 153 (set (make-local-variable 'dired-subdir-alist) |
145 (list (cons default-directory (point-min-marker))))) | 154 (list (cons default-directory (point-min-marker))))) |
155 (set (make-local-variable 'dired-subdir-switches) find-ls-subdir-switches) | |
146 (setq buffer-read-only nil) | 156 (setq buffer-read-only nil) |
147 ;; Subdir headlerline must come first because the first marker in | 157 ;; Subdir headlerline must come first because the first marker in |
148 ;; subdir-alist points there. | 158 ;; subdir-alist points there. |
149 (insert " " dir ":\n") | 159 (insert " " dir ":\n") |
150 ;; Make second line a ``find'' line in analogy to the ``total'' or | 160 ;; Make second line a ``find'' line in analogy to the ``total'' or |
265 ;; process is dead, we can delete it now. Otherwise it | 275 ;; process is dead, we can delete it now. Otherwise it |
266 ;; will stay around until M-x list-processes. | 276 ;; will stay around until M-x list-processes. |
267 (delete-process proc) | 277 (delete-process proc) |
268 (force-mode-line-update))) | 278 (force-mode-line-update))) |
269 (message "find-dired %s finished." (current-buffer)))))) | 279 (message "find-dired %s finished." (current-buffer)))))) |
280 | |
270 | 281 |
271 (provide 'find-dired) | 282 (provide 'find-dired) |
272 | 283 |
273 ;;; arch-tag: 8edece95-af00-4221-bc74-a4bd2f75f9b0 | 284 ;;; arch-tag: 8edece95-af00-4221-bc74-a4bd2f75f9b0 |
274 ;;; find-dired.el ends here | 285 ;;; find-dired.el ends here |