In interactive usage, the actual value of this variable is set up
by `grep-compute-defaults' when the default value is `auto-detect'.
-To change the default value, use Customize or call the function
+To change the default value, use \\[customize] or call the function
`grep-apply-setting'."
:type '(choice (const :tag "Do not highlight matches with grep markers" nil)
(const :tag "Highlight matches with grep markers" t)
In interactive usage, the actual value of this variable is set up
by `grep-compute-defaults'; to change the default value, use
-Customize or call the function `grep-apply-setting'."
+\\[customize] or call the function `grep-apply-setting'."
:type '(choice string
(const :tag "Not Set" nil))
:set 'grep-apply-setting
In interactive usage, the actual value of this variable is set up
by `grep-compute-defaults'; to change the default value, use
-Customize or call the function `grep-apply-setting'."
+\\[customize] or call the function `grep-apply-setting'."
:type '(choice string
(const :tag "Not Set" nil))
:set 'grep-apply-setting
In interactive usage, the actual value of this variable is set up
by `grep-compute-defaults'; to change the default value, use
-Customize or call the function `grep-apply-setting'."
+\\[customize] or call the function `grep-apply-setting'."
:type '(choice (const :tag "Do Not Append Null Device" nil)
(const :tag "Append Null Device" t)
(other :tag "Not Set" auto-detect))
"The default find command for \\[grep-find].
In interactive usage, the actual value of this variable is set up
by `grep-compute-defaults'; to change the default value, use
-Customize or call the function `grep-apply-setting'."
+\\[customize] or call the function `grep-apply-setting'."
:type '(choice string
(const :tag "Not Set" nil))
:set 'grep-apply-setting
<R> - the regular expression searched for.
In interactive usage, the actual value of this variable is set up
by `grep-compute-defaults'; to change the default value, use
-Customize or call the function `grep-apply-setting'."
+\\[customize] or call the function `grep-apply-setting'."
:type '(choice string
(const :tag "Not Set" nil))
:set 'grep-apply-setting
:type 'alist
:group 'grep)
-(defcustom grep-find-ignored-directories
- vc-directory-exclusion-list
+(defcustom grep-find-ignored-directories vc-directory-exclusion-list
"List of names of sub-directories which `rgrep' shall not recurse into.
If an element is a cons cell, the car is called on the search directory
-to determine whether cdr should not be recursed into."
+to determine whether cdr should not be recursed into.
+
+The default value is inherited from `vc-directory-exclusion-list'."
:type '(choice (repeat :tag "Ignored directories" string)
(const :tag "No ignored directories" nil))
:group 'grep)
;;;###autoload
(defun grep-compute-defaults ()
+ "Compute the defaults for the `grep' command.
+The value depends on `grep-command', `grep-template',
+`grep-use-null-device', `grep-find-command', `grep-find-template',
+`grep-use-null-filename-separator', `grep-find-use-xargs' and
+`grep-highlight-matches'."
;; Keep default values.
(unless grep-host-defaults-alist
(add-to-list
;;;###autoload
(defun grep (command-args)
- "Run Grep with user-specified COMMAND-ARGS, collect output in a buffer.
+ "Run Grep with user-specified COMMAND-ARGS.
+The output from the command goes to the \"*grep*\" buffer.
+
While Grep runs asynchronously, you can use \\[next-error] (M-x next-error),
or \\<grep-mode-map>\\[compile-goto-error] in the *grep* \
buffer, to go to the lines where Grep found
;;;###autoload
(defun grep-find (command-args)
"Run grep via find, with user-specified args COMMAND-ARGS.
-Collect output in a buffer.
+Collect output in the \"*grep*\" buffer.
While find runs asynchronously, you can use the \\[next-error] command
to find the text that grep hits refer to.
("<X>" . excl)
("<R>" . (shell-quote-argument (or regexp ""))))
"List of substitutions performed by `grep-expand-template'.
-If car of an element matches, the cdr is evalled in to get the
-substitution string. Note dynamic scoping of variables.")
+If car of an element matches, the cdr is evalled in order to get the
+substitution string.
+
+The substitution is based on variables bound dynamically, and
+these include `opts', `dir', `files', `null-device', `excl' and
+`regexp'.")
(defun grep-expand-template (template &optional regexp files dir excl)
- "Patch grep COMMAND string replacing <C>, <D>, <F>, <R>, and <X>."
+ "Expand grep COMMAND string replacing <C>, <D>, <F>, <R>, and <X>."
(let* ((command template)
(env `((opts . ,(let (opts)
(when (and case-fold-search
"Read a file-name pattern arg for interactive grep.
The pattern can include shell wildcards. As whitespace triggers
completion when entering a pattern, including it requires
-quoting, e.g. `\\[quoted-insert]<space>'."
+quoting, e.g. `\\[quoted-insert]<space>'.
+
+REGEXP is used as a string in the prompt."
(let* ((grep-read-files-function (get major-mode 'grep-read-files))
(file-name-at-point
(run-hook-with-args-until-success 'file-name-at-point-functions))
before it is executed.
With two \\[universal-argument] prefixes, directly edit and run `grep-command'.
-Collect output in a buffer. While grep runs asynchronously, you
+Collect output in the \"*grep*\" buffer. While grep runs asynchronously, you
can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error] \
in the grep output buffer,
to go to the lines where grep found matches.
-This command shares argument histories with \\[rgrep] and \\[grep]."
+This command shares argument histories with \\[rgrep] and \\[grep].
+
+If CONFIRM, the user will be given an opportunity to edit the
+command before it's run."
(interactive
(progn
(grep-compute-defaults)
before it is executed.
With two \\[universal-argument] prefixes, directly edit and run `grep-find-command'.
-Collect output in a buffer. While the recursive grep is running,
+Collect output in the \"*grep*\" buffer. While the recursive grep is running,
you can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error] \
in the grep output buffer,
to visit the lines where matches were found. To kill the job
This command shares argument histories with \\[lgrep] and \\[grep-find].
When called programmatically and FILES is nil, REGEXP is expected
-to specify a command to run."
+to specify a command to run.
+
+If CONFIRM, the user will be given an opportunity to edit the
+command before it's run."
(interactive
(progn
(grep-compute-defaults)
(defun zrgrep (regexp &optional files dir confirm template)
"Recursively grep for REGEXP in gzipped FILES in tree rooted at DIR.
Like `rgrep' but uses `zgrep' for `grep-program', sets the default
-file name to `*.gz', and sets `grep-highlight-matches' to `always'."
+file name to `*.gz', and sets `grep-highlight-matches' to `always'.
+
+If CONFIRM, the user will be given an opportunity to edit the
+command before it's run."
(interactive
(progn
;; Compute standard default values.