From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#29303: 25.2; vc-git-grep should shell-escape FILES Date: Fri, 17 Nov 2017 10:54:59 +0100 Message-ID: <878tf5fcwc.fsf@gmail.com> References: <87efoz983o.fsf@gmail.com> <83d14jjv5y.fsf@gnu.org> <87375fpehr.fsf@gmail.com> <837eurjoue.fsf@gnu.org> <87tvxvnvog.fsf@gmail.com> <83y3n7i90b.fsf@gnu.org> <87lgj7nuti.fsf@gmail.com> <83vaiai68j.fsf@gnu.org> <878tf5nvue.fsf@gmail.com> <83375di8am.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1510912577 27776 195.159.176.226 (17 Nov 2017 09:56:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 17 Nov 2017 09:56:17 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: 29303@debbugs.gnu.org, gus@inodes.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 17 10:56:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFdNY-0006fg-D7 for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Nov 2017 10:56:08 +0100 Original-Received: from localhost ([::1]:44795 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFdNe-0003Rk-3g for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Nov 2017 04:56:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFdNX-0003RP-C4 for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 04:56:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFdNS-0002lz-DN for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 04:56:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35566) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eFdNS-0002ls-9H for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 04:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eFdNS-0000Mp-0B for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 04:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Nov 2017 09:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29303 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29303-submit@debbugs.gnu.org id=B29303.15109125081305 (code B ref 29303); Fri, 17 Nov 2017 09:56:01 +0000 Original-Received: (at 29303) by debbugs.gnu.org; 17 Nov 2017 09:55:08 +0000 Original-Received: from localhost ([127.0.0.1]:44247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFdMa-0000Kz-BL for submit@debbugs.gnu.org; Fri, 17 Nov 2017 04:55:08 -0500 Original-Received: from mail-wm0-f44.google.com ([74.125.82.44]:44576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFdMZ-0000Kd-B8 for 29303@debbugs.gnu.org; Fri, 17 Nov 2017 04:55:07 -0500 Original-Received: by mail-wm0-f44.google.com with SMTP id r68so5263547wmr.3 for <29303@debbugs.gnu.org>; Fri, 17 Nov 2017 01:55:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:gmane-reply-to-list:date:in-reply-to :message-id:user-agent:mime-version; bh=AZ6uNwpfg7njP4EnRJAzpCEy/Bakkk5+o8EbyJxZBf0=; b=ireAXf0S4dzzni7gNcbbFozYZBG2VWWiZQ3ZPQVX4hId0LqrUTshDuuSleqxVRFdMq hSnv8InwtAOMikMV9zEP3uzo/jT/cNglRJOvybFU03k4De4F6ZCjL24Z7kVFULKPxL3H 168qiXCbpBTX0e6Q+VInk9tMygVhJsx0++ud6wJOOboXMevu4nbtXD/R4Mrql3qFf9EN ZwqgGcRRdX66n7mtQsfCeM5/8A1YJVKuUBlFIrmQSdKMEVa9QSaV6o6lHW7IwEnGuFuT umzw+fzDOc8rz2BdX2WPHS90fIIueNw5uwT860iMJa4fYES+QbMFVtnLqo0/J/RzdxVr epsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version; bh=AZ6uNwpfg7njP4EnRJAzpCEy/Bakkk5+o8EbyJxZBf0=; b=fGLETANE22GVUpMtTbLyErlmpOgK/Tsyl2G/qq7VStm2Rpx/uEndOwcOrwQ4exKojh Tz2G/OjULutp5RmO984vAucnJPwDwLzQdV7SUSLCy7EhTSSZxfaYlWTMuaacj8LB0+MZ ricbkxNa9vMfO/+oMAbkHZdthmUOjy7tu1q32jcSICBlNrasFdJIYaG3K21z8Q9aKm+d GIwes7USft9ver+Fo5/RLiwfGHV6vMOfw91WZKtNlc9jTxN2f0DpAituGIClgDDOBbaE 1r0OfhqGnOSYuaTeltlvsNncazS1ku2tYcorq+V8OTNp63E4WZKzMZS431ZPpPVHddN9 HcfQ== X-Gm-Message-State: AJaThX7R6FdqmnpD8IuoQwCEyIQZeh/dpz3BfkIvv/XB/iFZw4vEe8QE dWUkgtcJZFan3+6SzQ5eEcs= X-Google-Smtp-Source: AGs4zMZLjO88JPMuLZJL+BamRtKHeiA+7f7FhLa8hNgG/yFXjZ3zeRIXcVL/3QNeMZRXh5BCnBz2Wg== X-Received: by 10.80.131.38 with SMTP id 35mr6702615edh.291.1510912501391; Fri, 17 Nov 2017 01:55:01 -0800 (PST) Original-Received: from rpluim ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id 30sm2145064edz.42.2017.11.17.01.54.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Nov 2017 01:55:00 -0800 (PST) Gmane-Reply-To-List: yes In-Reply-To: <83375di8am.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 17 Nov 2017 11:06:09 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:139996 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Robert Pluim >> For vc-git-grep, or for every function that uses grep-read-files? > > The latter, I think. If there are too many of those callers, then we > could describe this once, say in grep-read-files, and then reference > that, with something like > > Including whitespace in the pattern requires quoting, see > `grep-read-files' for the details. There are only 4 such (5 if you count zrgrep, which basically says 'see rgrep') and the addition is small, so I documented it in the callers, and in grep-read-files. Robert --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Explain-how-to-enter-whitespace-when-using-grep-read.patch >From 2b0535557316518ea75945e0e7b20576b2bbea47 Mon Sep 17 00:00:00 2001 From: Robert Pluim 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..56aef15a08 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, eg `\C-q'." (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, eg `\C-q'. 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, eg `\C-q'. 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..06f5aa5c94 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, eg `\C-q'." (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..eaa31c5def 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, eg `\C-q'. With \\[universal-argument] prefix, you can edit the constructed shell command line before it is executed. -- 2.15.0.276.g89ea799ff --=-=-=--