From: no-spam@cua.dk (Kim F. Storm)
Cc: bug-gnu-emacs@gnu.org
Subject: Re: grep.el bugs: grep-find-use-xargs handling, non-use of shell-quote-argument, find-grep and alternative find
Date: Wed, 23 Aug 2006 00:28:40 +0200 [thread overview]
Message-ID: <m37j105rs7.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <44EB5844.1020509@tomseddon.plus.com> (Tom Seddon's message of "Tue, 22 Aug 2006 20:17:24 +0100")
Tom Seddon <bug-gnu-emacs@tomseddon.plus.com> writes:
> Hi,
>
> I've included a patch to fix three grep.el bugs.
Thank you for the bug report.
I will install fixes for these problems shortly.
>
> I'm using patched EmacsW32-1.06 (Emacs-22-CvsP060818-EmacsW32-1.06.exe)
> but grep.el looks to be the same as the latest one in CVS. OS is Windows
> XP, default shell is 4NT, and I'm using the GnuWin32 versions of find,
> grep and xargs.
>
> Firstly, grep-find-use-xargs handling is slightly wrong. The docs state
> that if grep-find-use-xargs is nil, xargs won't be used. But that isn't
> quite true -- if grep-find-use-xargs is nil, grep-compute-defaults tries
> to work out whether grep-find-use-xargs should actually be 'gnu.
>
> On my PC at least, 'gnu doesn't work (xargs gives the error "grep:
> Invalid argument"). I didn't look into this bit, because it seemed like
> you could make grep.el use find -exec instead. But that wasn't the case
> -- since I actually have a GNU xargs.exe available in the PATH it was
> impossible to make grep-compute-defaults set things up to use find -exec
> rather than xargs.
>
> Judging by the docstring for grep-find-use-xargs, this was wrong. The
> new behaviour is described in the new docstring. It should be
> backwards-compatible for all sensible uses. In particular, if
> grep-find-use-xargs is nil, the existing autodetection is still performed.
>
> (Perhaps I should just have figured out why xargs doesn't work...)
>
> The second bug is that grep.el doesn't use shell-quote-argument when
> constructing the args for find. It just use "\\(", "\\)" and "\\;"
> literally. This was causing errors on my PC:
>
> unixfind: paths must precede expression
> Usage: unixfind [-H] [-L] [-P] [path...] [expression]
>
> Changing grep.el to use shell-quote-argument where appropriate fixed this.
>
> Finally, grep.el mishandles the case where find-program is something
> other than "find". (Since Windows XP includes a "find.exe", I suppose
> others might be changing find-program to point at an
> alternatively-named version of GNU find.) See also:
>
> http://lists.gnu.org/archive/html/bug-gnu-emacs/2003-11/msg00029.html
>
> I've changed grep-compute-defaults accordingly, so that M-x find-grep
> puts the cursor at the right point.
--
Kim F. Storm http://www.cua.dk
next prev parent reply other threads:[~2006-08-22 22:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-22 19:17 grep.el bugs: grep-find-use-xargs handling, non-use of shell-quote-argument, find-grep and alternative find Tom Seddon
2006-08-22 22:28 ` Kim F. Storm [this message]
2006-08-23 23:25 ` Kim F. Storm
2006-08-24 17:53 ` Tom Seddon
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m37j105rs7.fsf@kfs-l.imdomain.dk \
--to=no-spam@cua.dk \
--cc=bug-gnu-emacs@gnu.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).