all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 29303@debbugs.gnu.org, gus@inodes.org
Subject: bug#29303: 25.2; vc-git-grep should shell-escape FILES
Date: Fri, 17 Nov 2017 11:33:08 +0100	[thread overview]
Message-ID: <87bmk1chzv.fsf@gmail.com> (raw)
In-Reply-To: <83wp2pgqlh.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 17 Nov 2017 12:13:46 +0200")

[-- Attachment #1: Type: text/plain, Size: 289 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Explain-how-to-enter-whitespace-when-using-grep-read.patch --]
[-- Type: text/x-patch, Size: 3932 bytes --]

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	other threads:[~2017-11-17 10:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15  6:25 bug#29303: 25.2; vc-git-grep should shell-escape FILES Angus Lees
2017-11-15  9:58 ` Robert Pluim
2017-11-15 17:42   ` Eli Zaretskii
2017-11-15 18:45     ` Robert Pluim
2017-11-15 19:58       ` Eli Zaretskii
2017-11-15 20:17         ` Robert Pluim
2017-11-15 20:26           ` Eli Zaretskii
2017-11-15 20:36             ` Robert Pluim
2017-11-16 15:38               ` Eli Zaretskii
2017-11-16 15:43                 ` Robert Pluim
2017-11-17  7:13                   ` Angus Lees
2017-11-17  8:38                 ` Robert Pluim
2017-11-17  9:06                   ` Eli Zaretskii
2017-11-17  9:54                     ` Robert Pluim
2017-11-17 10:13                       ` Eli Zaretskii
2017-11-17 10:33                         ` Robert Pluim [this message]
2017-11-17 13:41                           ` Eli Zaretskii
2017-11-17 14:21                             ` Robert Pluim
2017-11-28 13:37                               ` Robert Pluim
2017-11-28 17:49                                 ` Eli Zaretskii
2017-11-16 15:55         ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bmk1chzv.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=29303@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=gus@inodes.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.