unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "積丹尼 Dan Jacobson" <jidanni@jidanni.org>
To: 36558@debbugs.gnu.org
Subject: bug#36558: When the user forgets the filename when using M-x grep
Date: Tue, 09 Jul 2019 08:04:02 +0800	[thread overview]
Message-ID: <87lfx8f4zx.5.fsf@jidanni.org> (raw)

I don't think the M-x grep command has the ability for the user to
change the default prompt from the current

Run grep (like this): grep --color -nH --null -e

to the rather more sophisticated

Run grep (like this): grep --color -nH --null -e [] *

where "[]" represents where the cursor should be placed when prompting
the user.

Mentioning how to do so in (info "(emacs) Grep Searching")
or indeed, simply making it the new default, would save the 98% mistake
rate of users forgetting to add a filename and think there was no
matches (as outside of emacs this would hang without a filename,
alerting the user to the problem.)

Also M-x grep should detect that something tried to read stdin, meaning
the user forgot the filename, and then warn the user, instead of just
saying "No matches".

Currently this is a very high possibility the user will just do
Run grep (like this): grep --color -nH --null -e STRING
and forget FILENAMEs
creating an impossible situation, for which emacs currently just treats
as if the user did
Run grep (like this): grep --color -nH --null -e STRING /dev/null
which helps nobody.
At least emacs should catch this situation.





             reply	other threads:[~2019-07-09  0:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-09  0:04 積丹尼 Dan Jacobson [this message]
2019-07-10 12:22 ` bug#36558: When the user forgets the filename when using M-x grep Lars Ingebrigtsen
2019-07-10 23:22   ` Tak Kunihiro
2019-07-11  0:38   ` 積丹尼 Dan Jacobson
2019-07-11  9:44     ` Tak Kunihiro
2019-07-11 18:48       ` 積丹尼 Dan Jacobson

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=87lfx8f4zx.5.fsf@jidanni.org \
    --to=jidanni@jidanni.org \
    --cc=36558@debbugs.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).