unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36558: When the user forgets the filename when using M-x grep
@ 2019-07-09  0:04 積丹尼 Dan Jacobson
  2019-07-10 12:22 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: 積丹尼 Dan Jacobson @ 2019-07-09  0:04 UTC (permalink / raw)
  To: 36558

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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36558: When the user forgets the filename when using M-x grep
  2019-07-09  0:04 bug#36558: When the user forgets the filename when using M-x grep 積丹尼 Dan Jacobson
@ 2019-07-10 12:22 ` Lars Ingebrigtsen
  2019-07-10 23:22   ` Tak Kunihiro
  2019-07-11  0:38   ` 積丹尼 Dan Jacobson
  0 siblings, 2 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-10 12:22 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 36558

積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

> 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.

I virtually never want to grep all files in a directory, so having to
hit `C-k' first would be a disadvantage, I think.  And this is the kind
of interface twiddling that annoys people used to the old defaults, so
I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36558: When the user forgets the filename when using M-x grep
  2019-07-10 12:22 ` Lars Ingebrigtsen
@ 2019-07-10 23:22   ` Tak Kunihiro
  2019-07-11  0:38   ` 積丹尼 Dan Jacobson
  1 sibling, 0 replies; 6+ messages in thread
From: Tak Kunihiro @ 2019-07-10 23:22 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 36558, Lars Ingebrigtsen, tkk

>> 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.
>
> I virtually never want to grep all files in a directory, so having to
> hit `C-k' first would be a disadvantage, I think.  And this is the kind
> of interface twiddling that annoys people used to the old defaults, so
> I'm closing this bug report.

I had a similar thought.  I am OK now with following configuration.

(grep-apply-setting 'grep-command "grep -inHr . -e ")





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36558: When the user forgets the filename when using M-x grep
  2019-07-10 12:22 ` Lars Ingebrigtsen
  2019-07-10 23:22   ` Tak Kunihiro
@ 2019-07-11  0:38   ` 積丹尼 Dan Jacobson
  2019-07-11  9:44     ` Tak Kunihiro
  1 sibling, 1 reply; 6+ messages in thread
From: 積丹尼 Dan Jacobson @ 2019-07-11  0:38 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 36558

>>>>> "LI" == Lars Ingebrigtsen <larsi@gnus.org> writes:
LI> 積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

>> 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.

Indeed, grep.el is already so complicated...

LI> I virtually never want to grep all files in a directory, so having to

I'm the opposite.

LI> hit `C-k' first would be a disadvantage, I think.  And this is the kind
LI> of interface twiddling that annoys people used to the old defaults, so

I didn't say changing any defaults. I was asking for the "ability"...

LI> I'm closing this bug report.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36558: When the user forgets the filename when using M-x grep
  2019-07-11  0:38   ` 積丹尼 Dan Jacobson
@ 2019-07-11  9:44     ` Tak Kunihiro
  2019-07-11 18:48       ` 積丹尼 Dan Jacobson
  0 siblings, 1 reply; 6+ messages in thread
From: Tak Kunihiro @ 2019-07-11  9:44 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 36558, Lars Ingebrigtsen, tkk

>>> 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.

How about something like this?

(grep-apply-setting 'grep-command (cons "grep --color -nH --null -e  *" 28))





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36558: When the user forgets the filename when using M-x grep
  2019-07-11  9:44     ` Tak Kunihiro
@ 2019-07-11 18:48       ` 積丹尼 Dan Jacobson
  0 siblings, 0 replies; 6+ messages in thread
From: 積丹尼 Dan Jacobson @ 2019-07-11 18:48 UTC (permalink / raw)
  To: Tak Kunihiro; +Cc: 36558, Lars Ingebrigtsen, tkk

>>>>> "TK" == Tak Kunihiro <homeros.misasa@gmail.com> writes:
TK> How about something like this?
TK> (grep-apply-setting 'grep-command (cons "grep --color -nH --null -e  *" 28))

Ah! But I need something that I can put in (some grep hook in) .emacs. Something without the
flags hardwired into it. Something that just takes what grep gives me
and then adds "  *" to it and moves backwards like yours does without
hardwiring numbers. And even worth mentioning on grep's docstring too.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-11 18:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-09  0:04 bug#36558: When the user forgets the filename when using M-x grep 積丹尼 Dan Jacobson
2019-07-10 12:22 ` 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

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).