From: Robert Pluim Date: Fri, 17 Nov 2017 13:39:02 +0000 (+0200) Subject: Document how to enter whitespace when using grep-read-files X-Git-Tag: emacs-26.0.91~302 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=104f3e51fe6d22cf0ee280509df1b133cb8e1f89;p=emacs.git Document how to enter whitespace when using grep-read-files * lisp/progmodes/grep.el (lgrep, rgrep, grep-read-files): Explain how to enter whitespace when using grep-read-files. (Bug#29303) * lisp/progmodes/project.el (project-find-regexp): Likewise. * lisp/vc/vc-git.el (vc-git-grep): Likewise. --- diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index d0404fdeaf4..c2d80223541 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -904,7 +904,9 @@ substitution string. Note dynamic scoping of variables.") (defun grep-read-files (regexp) "Read a file-name pattern arg for interactive grep. -The pattern can include shell wildcards." +The pattern can include shell wildcards. As whitespace triggers +completion when entering a pattern, including it requires +quoting, e.g. `\\[quoted-insert]'." (let* ((bn (or (buffer-file-name) (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name)))) (fn (and bn @@ -954,7 +956,9 @@ The pattern can include shell wildcards." "Run grep, searching for REGEXP in FILES in directory DIR. The search is limited to file names matching shell pattern FILES. FILES may use abbreviations defined in `grep-files-aliases', e.g. -entering `ch' is equivalent to `*.[ch]'. +entering `ch' is equivalent to `*.[ch]'. As whitespace triggers +completion when entering a pattern, including it requires +quoting, e.g. `\\[quoted-insert]'. With \\[universal-argument] prefix, you can edit the constructed shell command line before it is executed. @@ -1032,7 +1036,9 @@ This command shares argument histories with \\[rgrep] and \\[grep]." "Recursively grep for REGEXP in FILES in directory tree rooted at DIR. The search is limited to file names matching shell pattern FILES. FILES may use abbreviations defined in `grep-files-aliases', e.g. -entering `ch' is equivalent to `*.[ch]'. +entering `ch' is equivalent to `*.[ch]'. As whitespace triggers +completion when entering a pattern, including it requires +quoting, e.g. `\\[quoted-insert]'. With \\[universal-argument] prefix, you can edit the constructed shell command line before it is executed. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 9dc0da4ad5c..93a945edaa4 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -307,7 +307,11 @@ DIRS must contain directory names." (defun project-find-regexp (regexp) "Find all matches for REGEXP in the current project's roots. With \\[universal-argument] prefix, you can specify the directory -to search in, and the file name pattern to search for." +to search in, and the file name pattern to search for. The +pattern may use abbreviations defined in `grep-files-aliases', +e.g. entering `ch' is equivalent to `*.[ch]'. As whitespace +triggers completion when entering a pattern, including it +requires quoting, e.g. `\\[quoted-insert]'." (interactive (list (project--read-regexp))) (let* ((pr (project-current t)) (dirs (if current-prefix-arg diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index ed85603f828..060072ea54d 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1407,7 +1407,9 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"." "Run git grep, searching for REGEXP in FILES in directory DIR. The search is limited to file names matching shell pattern FILES. FILES may use abbreviations defined in `grep-files-aliases', e.g. -entering `ch' is equivalent to `*.[ch]'. +entering `ch' is equivalent to `*.[ch]'. As whitespace triggers +completion when entering a pattern, including it requires +quoting, e.g. `\\[quoted-insert]'. With \\[universal-argument] prefix, you can edit the constructed shell command line before it is executed.