[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36558: When the user forgets the filename when using M-x grep

From: 積丹尼 Dan Jacobson
Subject: bug#36558: When the user forgets the filename when using M-x grep
Date: Tue, 09 Jul 2019 08:04:02 +0800

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 via email to

[Prev in Thread] Current Thread [Next in Thread]