unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13693: M-x grep should do some basic parameter checking
@ 2013-02-12  5:49 jidanni
  2013-02-12 17:52 ` Juri Linkov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: jidanni @ 2013-02-12  5:49 UTC (permalink / raw)
  To: 13693

Why doesn't M-x grep check that it has been given at least two
parameters, else it is bound to fail, as
$ grep
$ grep pattern
won't get far without some file arguments.

Yes
$ grep pattern pattern #wrong
will still pass as that would look the same as
$ grep pattern file
etc. but the check would be better than nothing.





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

* bug#13693: M-x grep should do some basic parameter checking
  2013-02-12  5:49 bug#13693: M-x grep should do some basic parameter checking jidanni
@ 2013-02-12 17:52 ` Juri Linkov
  2013-02-12 21:02 ` jidanni
  2013-02-13  8:55 ` jidanni
  2 siblings, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2013-02-12 17:52 UTC (permalink / raw)
  To: jidanni; +Cc: 13693

> Why doesn't M-x grep check that it has been given at least
> two parameters

Why two?  For example, for "git-grep pattern" just one is enough.





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

* bug#13693: M-x grep should do some basic parameter checking
  2013-02-12  5:49 bug#13693: M-x grep should do some basic parameter checking jidanni
  2013-02-12 17:52 ` Juri Linkov
@ 2013-02-12 21:02 ` jidanni
  2013-02-13  8:46   ` Juri Linkov
  2013-02-13  8:55 ` jidanni
  2 siblings, 1 reply; 6+ messages in thread
From: jidanni @ 2013-02-12 21:02 UTC (permalink / raw)
  To: juri; +Cc: 13693

>>>>> "JL" == Juri Linkov <juri@jurta.org> writes:
>> Why doesn't M-x grep check that it has been given at least
>> two parameters

JL> Why two?  For example, for "git-grep pattern" just one is enough.

$ emacs
(grep "grep -nH -e love")
Will always fail. And the user will think "well, I can't find the love
letter she sent me, and thus can't find her address, so I will just give
up," when all along he just forgot to give the filename.

Whereas normally
$ grep love
would hang, waiting for input, so he would know that the relationship
still had a chance, and it was just emacs that was the reason the two
would have lost touch...





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

* bug#13693: M-x grep should do some basic parameter checking
  2013-02-12 21:02 ` jidanni
@ 2013-02-13  8:46   ` Juri Linkov
  0 siblings, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2013-02-13  8:46 UTC (permalink / raw)
  To: jidanni; +Cc: 13693

> $ emacs
> (grep "grep -nH -e love")
> Will always fail. And the user will think "well, I can't find the love
> letter she sent me, and thus can't find her address, so I will just give
> up," when all along he just forgot to give the filename.
>
> Whereas normally
> $ grep love
> would hang, waiting for input, so he would know that the relationship
> still had a chance, and it was just emacs that was the reason the two
> would have lost touch...

If you tend to forget the pattern or file argument there is a reliable grep
known as `M-x rgrep' that asks you what and where to search.





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

* bug#13693: M-x grep should do some basic parameter checking
  2013-02-12  5:49 bug#13693: M-x grep should do some basic parameter checking jidanni
  2013-02-12 17:52 ` Juri Linkov
  2013-02-12 21:02 ` jidanni
@ 2013-02-13  8:55 ` jidanni
  2013-02-14  9:23   ` Juri Linkov
  2 siblings, 1 reply; 6+ messages in thread
From: jidanni @ 2013-02-13  8:55 UTC (permalink / raw)
  To: juri; +Cc: 13693

>>>>> "JL" == Juri Linkov <juri@jurta.org> writes:

JL> If you tend to forget the pattern or file argument there is a reliable grep
JL> known as `M-x rgrep' that asks you what and where to search.

Yes, I use that too.

And that is what is causing me to even remember less that M-x grep needs
more arguments when I use it !





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

* bug#13693: M-x grep should do some basic parameter checking
  2013-02-13  8:55 ` jidanni
@ 2013-02-14  9:23   ` Juri Linkov
  0 siblings, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2013-02-14  9:23 UTC (permalink / raw)
  To: jidanni; +Cc: 13693

> JL> If you tend to forget the pattern or file argument there is a reliable grep
> JL> known as `M-x rgrep' that asks you what and where to search.
>
> Yes, I use that too.
>
> And that is what is causing me to even remember less that M-x grep needs
> more arguments when I use it !

Then customize `grep-command' to something like "grep -nH -e pattern *"
that would remind you to replace the default search string "pattern"
and to replace "*" with actual file names to search.





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

end of thread, other threads:[~2013-02-14  9:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-12  5:49 bug#13693: M-x grep should do some basic parameter checking jidanni
2013-02-12 17:52 ` Juri Linkov
2013-02-12 21:02 ` jidanni
2013-02-13  8:46   ` Juri Linkov
2013-02-13  8:55 ` jidanni
2013-02-14  9:23   ` Juri Linkov

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