bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Kevin Rodgers
Subject: Re: M-x grep: time to clean up /dev/null kludge
Date: Thu, 20 Sep 2001 11:21:16 -0600

Eli Zaretskii wrote:
> 
> > From: Dan Jacobson <address@hidden>
> > Newsgroups: gnu.emacs.bug
> > Date: 15 Sep 2001 10:32:02 +0800
> >
> > You know, something has to be done about /dev/null kludge in M-x grep:
> > (grep "grep -n -e www *|wc")
> >
> > cd ~/geocities/
> > grep -n -e www *|wc /dev/null
> >       0       0       0 /dev/null
> >
> > grep finished (matches found) at Sat Sep 15 10:21:46
> >
> > I mean I know it is there to modify grep output in the minimal case of
> > one file name etc.  But, then useful commands like
> >
> > (grep "grep -n -e www *|grep -v http://";)
> >
> > are precluded.
> 
> 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.  But if that's too much
of a bother and writing a macro to do it is too much of a bother, users like
Dan might get by with something like this:

(defadvice grep (around null-device activate)
  "Temporarily unset `null-device' so that it isn't appended to COMMAND."
  (let ((null-device nil))
    ad-do-it))

-- 
Kevin Rodgers <address@hidden>



reply via email to

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