unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: al.coyote@gmail.com
To: help-gnu-emacs@gnu.org
Subject: Re: How to avoid /dev/null at the end of grep-command
Date: 3 Mar 2007 00:09:46 -0800	[thread overview]
Message-ID: <1172909386.423112.219580@z35g2000cwz.googlegroups.com> (raw)
In-Reply-To: <mailman.334.1172843352.7795.help-gnu-emacs@gnu.org>

Hello Eli,

On 2 mar, 14:49, Eli Zaretskii <e...@gnu.org> wrote:
> > From: al.coy...@gmail.com
> > Date: 2 Mar 2007 01:20:35 -0800
>
> > Any solution to avoid the /dev/null, without modifying compile.el ?
>
> I'm guessing that this is Emacs 21.x; if not, holler.  (I shouldn't be
> guessing, btw: please always state your Emacs version and the OS.)
>
> One way to work around this is to write a wrapper command that binds
> null-device to nil and then invokes the original `grep' command.  You
> can put this command in your .emacs.

I'm using emacs 21 on linux, but as this feature comes from compile.el
the behaviour should be the same on most architectures.
This behaviour is very old, maybe version 20 and even 19 did have it
(sorry I don't have these versions handy).

Thanks for your suggestion, I have found another one. Just end your
complex command with cat -, this command will do nothing except
protect from the /dev/null
So M-x grep with grep -n -A2 printf * | grep '\\n' | sed -e s/-/:/g |
cat -
will be transformed by emacs into
grep -n -A2 printf * | grep '\\n' | sed -e s/-/:/g | cat - /dev/null
which will do the job.

Al

  parent reply	other threads:[~2007-03-03  8:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-02  9:20 How to avoid /dev/null at the end of grep-command al.coyote
2007-03-02 13:49 ` Eli Zaretskii
     [not found] ` <mailman.334.1172843352.7795.help-gnu-emacs@gnu.org>
2007-03-03  8:09   ` al.coyote [this message]
2007-03-03 10:26     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1172909386.423112.219580@z35g2000cwz.googlegroups.com \
    --to=al.coyote@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).