aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Rumney2007-12-21 10:32:38 +0000
committerJason Rumney2007-12-21 10:32:38 +0000
commitd1dbc07ca2eba99092e9dd55ed78e70b295836d7 (patch)
treecfb56f348d70650755de7ab71f650e7a1a516e55
parent888b59787114c5d931935c49efd9861e8fa382d3 (diff)
downloademacs-d1dbc07ca2eba99092e9dd55ed78e70b295836d7.tar.gz
emacs-d1dbc07ca2eba99092e9dd55ed78e70b295836d7.zip
(find-name-arg): New custom variable.
(find-name-dired): Use it. (find-dired-find-program): Remove. (find-dired): Use find-program. (find-grep-dired): Use grep-program.
-rw-r--r--lisp/find-dired.el23
1 files changed, 15 insertions, 8 deletions
diff --git a/lisp/find-dired.el b/lisp/find-dired.el
index 0a3de850762..8a8304c6763 100644
--- a/lisp/find-dired.el
+++ b/lisp/find-dired.el
@@ -36,11 +36,6 @@
36 :group 'dired 36 :group 'dired
37 :prefix "find-") 37 :prefix "find-")
38 38
39(defcustom find-dired-find-program "find"
40 "Program used to find files."
41 :group 'dired
42 :type 'file)
43
44;; find's -ls corresponds to these switches. 39;; find's -ls corresponds to these switches.
45;; Note -b, at least GNU find quotes spaces etc. in filenames 40;; Note -b, at least GNU find quotes spaces etc. in filenames
46;;;###autoload 41;;;###autoload
@@ -77,6 +72,18 @@ On other systems, the closest you can come is to use `-l'."
77 :type 'string 72 :type 'string
78 :group 'find-dired) 73 :group 'find-dired)
79 74
75;;;###autoload
76(defcustom find-name-arg
77 (if read-file-name-completion-ignore-case
78 "-iname"
79 "-name")
80 "*Argument used to specify file name pattern.
81If `read-file-name-completion-ignore-case' is non-nil, -iname is used so that
82find also ignores case. Otherwise, -name is used."
83 :type 'string
84 :group 'find-dired
85 :version "22.2")
86
80(defvar find-args nil 87(defvar find-args nil
81 "Last arguments given to `find' by \\[find-dired].") 88 "Last arguments given to `find' by \\[find-dired].")
82 89
@@ -126,7 +133,7 @@ as the final argument."
126 (erase-buffer) 133 (erase-buffer)
127 (setq default-directory dir 134 (setq default-directory dir
128 find-args args ; save for next interactive call 135 find-args args ; save for next interactive call
129 args (concat find-dired-find-program " . " 136 args (concat find-program " . "
130 (if (string= args "") 137 (if (string= args "")
131 "" 138 ""
132 (concat 139 (concat
@@ -198,7 +205,7 @@ The command run (after changing into DIR) is
198 find . -name 'PATTERN' -ls" 205 find . -name 'PATTERN' -ls"
199 (interactive 206 (interactive
200 "DFind-name (directory): \nsFind-name (filename wildcard): ") 207 "DFind-name (directory): \nsFind-name (filename wildcard): ")
201 (find-dired dir (concat "-name " (shell-quote-argument pattern)))) 208 (find-dired dir (concat find-name-arg " " (shell-quote-argument pattern))))
202 209
203;; This functionality suggested by 210;; This functionality suggested by
204;; From: oblanc@watcgl.waterloo.edu (Olivier Blanc) 211;; From: oblanc@watcgl.waterloo.edu (Olivier Blanc)
@@ -222,7 +229,7 @@ Thus ARG can also contain additional grep options."
222 ;; by FIFOs and devices. I'm not sure what's best to do 229 ;; by FIFOs and devices. I'm not sure what's best to do
223 ;; about symlinks, so as far as I know this is not wrong. 230 ;; about symlinks, so as far as I know this is not wrong.
224 (find-dired dir 231 (find-dired dir
225 (concat "-type f -exec grep " find-grep-options " -e " 232 (concat "-type f -exec " grep-program " " find-grep-options " -e "
226 (shell-quote-argument regexp) 233 (shell-quote-argument regexp)
227 " " 234 " "
228 (shell-quote-argument "{}") 235 (shell-quote-argument "{}")