[Top][All Lists]

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

Re: M-x grep: time to clean up /dev/null kludge

From: Miles Bader
Subject: Re: M-x grep: time to clean up /dev/null kludge
Date: Thu, 20 Sep 2001 17:36:58 GMT

kevinr@ihs.com (Kevin Rodgers) writes:
> > M-x grep is not supposed to be used with an arbitrary shell commands;
> > you have "M-!" for that.
> Indeed, and then one can turn on compilation-minor-mode in the *Shell Command
> Output* buffer so that next-error (C-x `) etc. work.

Anyway, it's a cop-out to say `grep is not supposed to be used with
arbitrary shell commands.'  I think it's quite common to want to filter
the output of grep when using `M-x grep' (certainly I often want to do
it), and there's no particular reason to disallow it other than the
/dev/null kludge.

Morever, the /dev/null kludge is not necessary when using GNU grep,
because you can use the `-H' option to grep instead.

Perhaps the `M-x grep' code should run some sort of test the first time
it's used to determine if the `-H' option is supported, and if so, use it
and punt the use of /dev/null.  [it doesn't seem very difficult -- just
call grep with -H and a single well-known file as an argument, and if
the process exits successfully with the right output, you win.]

"I distrust a research person who is always obviously busy on a task."
   --Robert Frosch, VP, GM Research

reply via email to

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