Mercurial > emacs
comparison lisp/progmodes/compile.el @ 47787:1207b03521f9
(grep-compute-defaults): Set the standard-value
properties of the variables being initialized.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 07 Oct 2002 22:48:47 +0000 |
parents | 5128d5a8980c |
children | c27fdc870952 |
comparison
equal
deleted
inserted
replaced
47786:a9de3e936eef | 47787:1207b03521f9 |
---|---|
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)))) | |
104 (unless grep-find-use-xargs | 105 (unless grep-find-use-xargs |
105 (setq grep-find-use-xargs | 106 (setq grep-find-use-xargs |
106 (if (and | 107 (if (and |
107 (equal (call-process "find" nil nil nil | 108 (equal (call-process "find" nil nil nil |
108 null-device "-print0") | 109 null-device "-print0") |
109 0) | 110 0) |
110 (equal (call-process "xargs" nil nil nil | 111 (equal (call-process "xargs" nil nil nil |
111 "-0" "-e" "echo") | 112 "-0" "-e" "echo") |
112 0)) | 113 0)) |
113 'gnu))) | 114 'gnu)) |
115 (put 'grep-find-use-xargs 'standard-value | |
116 (list (custom-quote grep-find-use-xargs)))) | |
114 (unless grep-find-command | 117 (unless grep-find-command |
115 (setq grep-find-command | 118 (setq grep-find-command |
116 (cond ((eq grep-find-use-xargs 'gnu) | 119 (cond ((eq grep-find-use-xargs 'gnu) |
117 (format "%s . -type f -print0 | xargs -0 -e %s" | 120 (format "%s . -type f -print0 | xargs -0 -e %s" |
118 find-program grep-command)) | 121 find-program grep-command)) |
119 (grep-find-use-xargs | 122 (grep-find-use-xargs |
120 (format "%s . -type f -print | xargs %s" | 123 (format "%s . -type f -print | xargs %s" |
121 find-program grep-command)) | 124 find-program grep-command)) |
122 (t (cons (format "%s . -type f -exec %s {} %s \\;" | 125 (t (cons (format "%s . -type f -exec %s {} %s \\;" |
123 find-program grep-command null-device) | 126 find-program grep-command null-device) |
124 (+ 22 (length grep-command))))))) | 127 (+ 22 (length grep-command)))))) |
128 (put 'grep-find-command 'standard-value | |
129 (list (custom-quote grep-find-command)))) | |
125 (unless grep-tree-command | 130 (unless grep-tree-command |
126 (setq grep-tree-command | 131 (setq grep-tree-command |
127 (let* ((glen (length grep-program)) | 132 (let* ((glen (length grep-program)) |
128 (gcmd (concat grep-program " <C>" (substring grep-command glen)))) | 133 (gcmd (concat grep-program " <C>" (substring grep-command glen)))) |
129 (cond ((eq grep-find-use-xargs 'gnu) | 134 (cond ((eq grep-find-use-xargs 'gnu) |
131 find-program gcmd)) | 136 find-program gcmd)) |
132 (grep-find-use-xargs | 137 (grep-find-use-xargs |
133 (format "%s <D> <X> -type f <F> -print | xargs %s <R>" | 138 (format "%s <D> <X> -type f <F> -print | xargs %s <R>" |
134 find-program gcmd)) | 139 find-program gcmd)) |
135 (t (format "%s <D> <X> -type f <F> -exec %s <R> {} %s \\;" | 140 (t (format "%s <D> <X> -type f <F> -exec %s <R> {} %s \\;" |
136 find-program gcmd null-device))))))) | 141 find-program gcmd null-device))))) |
142 (put 'grep-tree-command 'standard-value | |
143 (list (custom-quote grep-tree-command))))) | |
137 | 144 |
138 (defcustom grep-command nil | 145 (defcustom grep-command nil |
139 "The default grep command for \\[grep]. | 146 "The default grep command for \\[grep]. |
140 If the grep program used supports an option to always include file names | 147 If the grep program used supports an option to always include file names |
141 in its output (such as the `-H' option to GNU grep), it's a good idea to | 148 in its output (such as the `-H' option to GNU grep), it's a good idea to |