From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Piping output to a buffer Date: Mon, 25 Feb 2008 22:11:20 -0500 Organization: Symantec Message-ID: References: <877igtho8a.fsf@celephais.home.net> <853arhy156.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1204001449 4690 80.91.229.12 (26 Feb 2008 04:50:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Feb 2008 04:50:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 26 05:51:15 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JTrmb-0001Ns-88 for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Feb 2008 05:51:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTrm5-0001Ga-BW for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Feb 2008 23:50:41 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Mon, 25 Feb 2008 21:11:20 -0600 Original-Newsgroups: gnu.emacs.help Mail-Copies-To: nobody User-Agent: MT-NewsWatcher/3.5.3b2 (PPC Mac OS X) X-Copies-To: never Original-Lines: 40 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 24.34.108.171 Original-X-Trace: sv3-UCpsynKcJlhtWZBbJBk18xgd1DI08cD5b/ZSG9YsIkSSTEVqhzTPisbo6rN3VHL5/5V6kEyJSzFU8j7!DLOy1tXnmL7pF7Tvn/zD3NLrGHUzqGqqEFgPoSR0Th3CLdxEhvQo1H1++4xRCBm6zjE6Z9SQvESb!CCe7X1lOv4uvUWKcdnpuWqV9hfUTdOUkVIYv7DWX3A== Original-X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.37 Original-Xref: shelby.stanford.edu gnu.emacs.help:156493 X-Mailman-Approved-At: Mon, 25 Feb 2008 23:50:25 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:51868 Archived-At: In article <853arhy156.fsf@lola.goethe.zz>, David Kastrup wrote: > Barry Margolin writes: > > > In article <877igtho8a.fsf@celephais.home.net>, > > cothrige 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, barmar@alum.mit.edu 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 ***