bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#29303: 25.2; vc-git-grep should shell-escape FILES


From: Robert Pluim
Subject: bug#29303: 25.2; vc-git-grep should shell-escape FILES
Date: Fri, 17 Nov 2017 11:33:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> Thanks, this is fine, except that please use \\[quoted-insert] instead
> of a literal \C-q, to DTRT when quoted-insert is rebound to some other
> key.

Attached. I fixed my laziness about 'e.g.' for good measure. I'm
hoping this can make emacs-26.

>From 69a68ceed22ab78c1f6d578c3ad9781f32b0f218 Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim@gmail.com>
Date: Fri, 17 Nov 2017 10:51:26 +0100
Subject: [PATCH] Explain how to enter whitespace when using grep-read-files

* lisp/progmodes/grep.el (lgrep): Explain how to enter
whitespace when using grep-read-files.
(rgrep): Likewise.
(grep-read-files): Likewise.
* lisp/progmodes/project.el (project-find-regexp): Likewise.
* lisp/vc/vc-git.el (vc-git-grep): Likewise.
---
 lisp/progmodes/grep.el    | 12 +++++++++---
 lisp/progmodes/project.el |  6 +++++-
 lisp/vc/vc-git.el         |  4 +++-
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index d0404fdeaf..c2d8022354 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -904,7 +904,9 @@ grep-read-regexp
 
 (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]<space>'."
   (let* ((bn (or (buffer-file-name)
                 (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name))))
         (fn (and bn
@@ -954,7 +956,9 @@ lgrep
   "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]<space>'.
 
 With \\[universal-argument] prefix, you can edit the constructed shell command 
line
 before it is executed.
@@ -1032,7 +1036,9 @@ rgrep
   "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]<space>'.
 
 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 9dc0da4ad5..2dc1d9a070 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -307,7 +307,11 @@ project--value-in-dir
 (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]<space>'."
   (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 43164b4fcf..bcb10a544f 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1407,7 +1407,9 @@ vc-git-grep
   "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]<space>'.
 
 With \\[universal-argument] prefix, you can edit the constructed shell command 
line
 before it is executed.
-- 
2.15.0.276.g89ea799ff


reply via email to

[Prev in Thread] Current Thread [Next in Thread]