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

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

Re: Piping output to a buffer


From: Barry Margolin
Subject: Re: Piping output to a buffer
Date: Mon, 25 Feb 2008 22:11:20 -0500
User-agent: MT-NewsWatcher/3.5.3b2 (PPC Mac OS X)

In article <address@hidden>, David Kastrup <address@hidden> 
wrote:

> Barry Margolin <address@hidden> writes:
> 
> > In article <address@hidden>,
> >  cothrige <address@hidden> wrote:
> >
> >> I have noticed that in vim one can invoke an external command and pipe
> >> the output into the current buffer via the `!!` or `:r!` commands.
> >> While I have not made a habit of really using this command in vim, as I
> >> have also not made a habit of using vim, I did realize that this could
> >> be a really useful capability.  So, how might one do this in emacs?
> >
> > C-u M-!
> 
> !! pipes the current line through the external command.  The Emacs
> equivalent to that would be marking the line and then using
> 
> C-u M-|
> 
> I consider it more likely that your variant will be needed, however:
> more often than not, !! eating the current line is a nuisance rather
> than a benefit in vi.

Actually, I tend to use C-u M-| more often than C-u M-!.  For instance, 
when I want to reformat a file in the current buffer using awk, I use 
C-u M-|.  Had I realized that the vi commands the OP was talking about 
piped the buffer contents into the command, I would have mentioned M-| 
in my response.

I use M-! frequently as well, but I hardly ever insert the output into 
the buffer.  I usually use it just to run quick commands without 
switching to and cluttering up my shell buffer.

-- 
Barry Margolin, address@hidden
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


reply via email to

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