Mercurial > emacs
comparison lisp/progmodes/compile.el @ 48196:d5e00837e437
(grep-compute-defaults): Undo previous change.
(grep-command, grep-find-command, grep-tree-command): Allow value nil.
Do not declare :get property.
(grep-use-null-device): Doc fix. Fix type. Do not declare :get
property.
author | Markus Rost <rost@math.uni-bielefeld.de> |
---|---|
date | Thu, 07 Nov 2002 17:05:01 +0000 |
parents | c27fdc870952 |
children | caf0d482d3e3 |
comparison
equal
deleted
inserted
replaced
48195:1ecb81625b1d | 48196:d5e00837e437 |
---|---|
98 (call-process grep-program nil nil nil | 98 (call-process grep-program nil nil nil |
99 "-e" "foo" null-device) | 99 "-e" "foo" null-device) |
100 (error nil)) | 100 (error nil)) |
101 1) | 101 1) |
102 (format "%s %s -e " grep-program required-options) | 102 (format "%s %s -e " grep-program required-options) |
103 (format "%s %s " grep-program required-options)))) | 103 (format "%s %s " grep-program required-options))))) |
104 (put 'grep-command 'standard-value (list (custom-quote grep-command)))) | |
105 (unless grep-find-use-xargs | 104 (unless grep-find-use-xargs |
106 (setq grep-find-use-xargs | 105 (setq grep-find-use-xargs |
107 (if (and | 106 (if (and |
108 (equal (call-process "find" nil nil nil | 107 (equal (call-process "find" nil nil nil |
109 null-device "-print0") | 108 null-device "-print0") |
110 0) | 109 0) |
111 (equal (call-process "xargs" nil nil nil | 110 (equal (call-process "xargs" nil nil nil |
112 "-0" "-e" "echo") | 111 "-0" "-e" "echo") |
113 0)) | 112 0)) |
114 'gnu)) | 113 'gnu))) |
115 (put 'grep-find-use-xargs 'standard-value | |
116 (list (custom-quote grep-find-use-xargs)))) | |
117 (unless grep-find-command | 114 (unless grep-find-command |
118 (setq grep-find-command | 115 (setq grep-find-command |
119 (cond ((eq grep-find-use-xargs 'gnu) | 116 (cond ((eq grep-find-use-xargs 'gnu) |
120 (format "%s . -type f -print0 | xargs -0 -e %s" | 117 (format "%s . -type f -print0 | xargs -0 -e %s" |
121 find-program grep-command)) | 118 find-program grep-command)) |
122 (grep-find-use-xargs | 119 (grep-find-use-xargs |
123 (format "%s . -type f -print | xargs %s" | 120 (format "%s . -type f -print | xargs %s" |
124 find-program grep-command)) | 121 find-program grep-command)) |
125 (t (cons (format "%s . -type f -exec %s {} %s \\;" | 122 (t (cons (format "%s . -type f -exec %s {} %s \\;" |
126 find-program grep-command null-device) | 123 find-program grep-command null-device) |
127 (+ 22 (length grep-command)))))) | 124 (+ 22 (length grep-command))))))) |
128 (put 'grep-find-command 'standard-value | |
129 (list (custom-quote grep-find-command)))) | |
130 (unless grep-tree-command | 125 (unless grep-tree-command |
131 (setq grep-tree-command | 126 (setq grep-tree-command |
132 (let* ((glen (length grep-program)) | 127 (let* ((glen (length grep-program)) |
133 (gcmd (concat grep-program " <C>" (substring grep-command glen)))) | 128 (gcmd (concat grep-program " <C>" (substring grep-command glen)))) |
134 (cond ((eq grep-find-use-xargs 'gnu) | 129 (cond ((eq grep-find-use-xargs 'gnu) |
136 find-program gcmd)) | 131 find-program gcmd)) |
137 (grep-find-use-xargs | 132 (grep-find-use-xargs |
138 (format "%s <D> <X> -type f <F> -print | xargs %s <R>" | 133 (format "%s <D> <X> -type f <F> -print | xargs %s <R>" |
139 find-program gcmd)) | 134 find-program gcmd)) |
140 (t (format "%s <D> <X> -type f <F> -exec %s <R> {} %s \\;" | 135 (t (format "%s <D> <X> -type f <F> -exec %s <R> {} %s \\;" |
141 find-program gcmd null-device))))) | 136 find-program gcmd null-device))))))) |
142 (put 'grep-tree-command 'standard-value | |
143 (list (custom-quote grep-tree-command))))) | |
144 | 137 |
145 (defcustom grep-command nil | 138 (defcustom grep-command nil |
146 "The default grep command for \\[grep]. | 139 "The default grep command for \\[grep]. |
147 If the grep program used supports an option to always include file names | 140 If the grep program used supports an option to always include file names |
148 in its output (such as the `-H' option to GNU grep), it's a good idea to | 141 in its output (such as the `-H' option to GNU grep), it's a good idea to |
149 include it when specifying `grep-command'. | 142 include it when specifying `grep-command'. |
150 | 143 |
151 The default value of this variable is set up by `grep-compute-defaults'; | 144 The default value of this variable is set up by `grep-compute-defaults'; |
152 call that function before using this variable in your program." | 145 call that function before using this variable in your program." |
153 :type 'string | 146 :type '(choice string |
154 :get '(lambda (symbol) | 147 (const :tag "Not Set" nil)) |
155 (or grep-command | |
156 (progn (grep-compute-defaults) grep-command))) | |
157 :group 'compilation) | 148 :group 'compilation) |
158 | 149 |
159 (defcustom grep-use-null-device 'auto-detect | 150 (defcustom grep-use-null-device 'auto-detect |
160 "If non-nil, append the value of `null-device' to grep commands. | 151 "If t, append the value of `null-device' to `grep' commands. |
161 This is done to ensure that the output of grep includes the filename of | 152 This is done to ensure that the output of grep includes the filename of |
162 any match in the case where only a single file is searched, and is not | 153 any match in the case where only a single file is searched, and is not |
163 necessary if the grep program used supports the `-H' option. | 154 necessary if the grep program used supports the `-H' option. |
164 | 155 |
165 The default value of this variable is set up by `grep-compute-defaults'; | 156 The default value of this variable is set up by `grep-compute-defaults'; |
166 call that function before using this variable in your program." | 157 call that function before using this variable in your program." |
167 :type 'boolean | 158 :type 'boolean |
168 :get '(lambda (symbol) | 159 :type '(choice (const :tag "Do Not Append Null Device" nil) |
169 (if (and grep-use-null-device (not (eq grep-use-null-device t))) | 160 (const :tag "Append Null Device" t) |
170 (progn (grep-compute-defaults) grep-use-null-device) | 161 (other :tag "Not Set" auto-detect)) |
171 grep-use-null-device)) | |
172 :group 'compilation) | 162 :group 'compilation) |
173 | 163 |
174 (defcustom grep-find-command nil | 164 (defcustom grep-find-command nil |
175 "The default find command for \\[grep-find]. | 165 "The default find command for \\[grep-find]. |
176 The default value of this variable is set up by `grep-compute-defaults'; | 166 The default value of this variable is set up by `grep-compute-defaults'; |
177 call that function before using this variable in your program." | 167 call that function before using this variable in your program." |
178 :type 'string | 168 :type '(choice string |
179 :get (lambda (symbol) | 169 (const :tag "Not Set" nil)) |
180 (or grep-find-command | |
181 (progn (grep-compute-defaults) grep-find-command))) | |
182 :group 'compilation) | 170 :group 'compilation) |
183 | 171 |
184 (defcustom grep-tree-command nil | 172 (defcustom grep-tree-command nil |
185 "The default find command for \\[grep-tree]. | 173 "The default find command for \\[grep-tree]. |
186 The default value of this variable is set up by `grep-compute-defaults'; | 174 The default value of this variable is set up by `grep-compute-defaults'; |
189 <D> - base directory for find | 177 <D> - base directory for find |
190 <X> - find options to restrict or expand the directory list | 178 <X> - find options to restrict or expand the directory list |
191 <F> - find options to limit the files matched | 179 <F> - find options to limit the files matched |
192 <C> - place to put -i if case insensitive grep | 180 <C> - place to put -i if case insensitive grep |
193 <R> - the regular expression searched for." | 181 <R> - the regular expression searched for." |
194 :type 'string | 182 :type '(choice string |
183 (const :tag "Not Set" nil)) | |
195 :version "21.4" | 184 :version "21.4" |
196 :get (lambda (symbol) | |
197 (or grep-tree-command | |
198 (progn (grep-compute-defaults) grep-tree-command))) | |
199 :group 'compilation) | 185 :group 'compilation) |
200 | 186 |
201 (defcustom grep-tree-files-aliases '( | 187 (defcustom grep-tree-files-aliases '( |
202 ("ch" . "*.[ch]") | 188 ("ch" . "*.[ch]") |
203 ("c" . "*.c") | 189 ("c" . "*.c") |