Subject: bug#48302: closed (Re: [PATCH v2] Re: bug#48302: [PATCH] Abbreviate `find' properties in M-x rgrep on MS Windows)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 12 May 2021 08:50:02 +0000

Your bug report

#48302: [PATCH] Abbreviate `find' properties in M-x rgrep on MS Windows

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
48302: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=48302
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [PATCH v2] Re: bug#48302: [PATCH] Abbreviate `find' properties in M-x rgrep on MS Windows
From: Michael Albinus <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Wed, 12 May 2021 10:48:51 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Eli Zaretskii <[email-masked]> writes:

>> Eli, do you have further comments? Otherwise, I would commit it in Jim's
>> name.
>
> No further comments, but please be sure to mention the bug number in
> the commit log message.

Done, closing the bug.

> Thanks.

Best regards, Michael.

Subject: [PATCH] Abbreviate `find' properties in M-x rgrep on MS Windows
From: Jim Porter <[email-masked]>
To: [email-masked]
Date: Sat, 8 May 2021 15:17:14 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

MS Windows has different shell-quoting logic from POSIX shells, so the
regexp to abbreviate the `find' command's properties in rgrep fails to
match on MS Windows. The attached patch fixes this by looking for
either `\)' (POSIX) or `")"' (MS Windows) as the end of the properties
list.

Steps to reproduce:

  ;; Ensure GNU find and grep are in your path
  emacs -Q
  M-x rgrep RET foo RET RET RET
  ;; See the full, unabbreviated command instead of `find [...] -exec grep'...

To make things easier to review for people without access to MS
Windows, this is the full invocation for rgrep:

---------- Begin Block ----------

find . -type d "(" -path "*/SCCS" -o -path "*/RCS" -o -path "*/CVS" -o
-path "*/MCVS" -o -path "*/.src" -o -path "*/.svn" -o -path "*/.git"
-o -path "*/.hg" -o -path "*/.bzr" -o -path "*/_MTN" -o -path
"*/_darcs" -o -path "*/{arch}" ")" -prune -o ^"^!^" -type d "(" -name
".#*" -o -name "*.o" -o -name "*~" -o -name "*.bin" -o -name "*.bak"
-o -name "*.obj" -o -name "*.map" -o -name "*.ico" -o -name "*.pif" -o
-name "*.lnk" -o -name "*.a" -o -name "*.ln" -o -name "*.blg" -o -name
"*.bbl" -o -name "*.dll" -o -name "*.drv" -o -name "*.vxd" -o -name
"*.386" -o -name "*.elc" -o -name "*.lof" -o -name "*.glo" -o -name
"*.idx" -o -name "*.lot" -o -name "*.fmt" -o -name "*.tfm" -o -name
"*.class" -o -name "*.fas" -o -name "*.lib" -o -name "*.mem" -o -name
"*.x86f" -o -name "*.sparcf" -o -name "*.dfsl" -o -name "*.pfsl" -o
-name "*.d64fsl" -o -name "*.p64fsl" -o -name "*.lx64fsl" -o -name
"*.lx32fsl" -o -name "*.dx64fsl" -o -name "*.dx32fsl" -o -name
"*.fx64fsl" -o -name "*.fx32fsl" -o -name "*.sx64fsl" -o -name
"*.sx32fsl" -o -name "*.wx64fsl" -o -name "*.wx32fsl" -o -name
"*.fasl" -o -name "*.ufsl" -o -name "*.fsl" -o -name "*.dxl" -o -name
"*.lo" -o -name "*.la" -o -name "*.gmo" -o -name "*.mo" -o -name
"*.toc" -o -name "*.aux" -o -name "*.cp" -o -name "*.fn" -o -name
"*.ky" -o -name "*.pg" -o -name "*.tp" -o -name "*.vr" -o -name
"*.cps" -o -name "*.fns" -o -name "*.kys" -o -name "*.pgs" -o -name
"*.tps" -o -name "*.vrs" -o -name "*.pyc" -o -name "*.pyo" ")" -prune
-o  -type f "(" -iname "*" -o -iname ^".[^!.]*^" -o -iname "..?*" ")"
-exec grep --color=always -i -nH --null "foo" "{}" ";"

---------- End Block ----------