unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Glenn Morris <rgm@gnu.org>
Cc: Dave Abrahams <dave@boostpro.com>, 9226@debbugs.gnu.org
Subject: bug#9226: 23.3; [rgrep]; (matches found) ?
Date: Wed, 10 Aug 2011 09:35:55 -0400	[thread overview]
Message-ID: <jwv1uwtbdde.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <uzobzx20un.fsf@fencepost.gnu.org> (Glenn Morris's message of "Wed, 10 Aug 2011 03:16:00 -0400")

>> Why does emacs tell me "matches found" when none actually were?
> Because it uses the exit status of the "grep" command to decide whether
> matches were found. For standalone grep, an exit status of 0 means
> matches were found; but for "find -exec grep", an exit status of 0 just
> means "all files were processed successfully". There isn't any way to
> determine whether the grep in a "find -exec grep" succeeded based on
> exit status alone, therefore this Emacs feature as implemented cannot
> work for rgrep. With "find | xargs grep" it will do slightly better, but
> still report "exited abnormally" for the case of a grep that ran fine,
> but did not find any matches.

I suggest we remove this "matches found" thingy.  It was meant to be
a feature, but in the case where it works (i.e. for `grep') the rest of
the output already gives the information anyway.
We can replace it with the exit status code instead: it's more cryptic
but at least it never lies.


        Stefan





  reply	other threads:[~2011-08-10 13:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03  1:40 bug#9226: 23.3; [rgrep]; (matches found) ? Dave Abrahams
2011-08-10  7:16 ` Glenn Morris
2011-08-10 13:35   ` Stefan Monnier [this message]
2011-08-10 15:10     ` Juri Linkov
2011-08-17 14:52       ` Dave Abrahams
2011-08-17 15:02         ` Lennart Borgman
2011-08-17 16:50         ` Juri Linkov
2011-08-22  9:54           ` Juri Linkov
2011-09-17 18:24           ` Juri Linkov

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=jwv1uwtbdde.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=9226@debbugs.gnu.org \
    --cc=dave@boostpro.com \
    --cc=rgm@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).