From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: scame@fastmail.fm Newsgroups: gmane.emacs.help Subject: Re: Run Shell Command on Buffer Date: Thu, 25 Jan 2007 11:11:38 +0100 Message-ID: <1169719898.5250.1171149107@webmail.messagingengine.com> References: <8572445.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1169719925 10829 80.91.229.12 (25 Jan 2007 10:12:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Jan 2007 10:12:05 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 25 11:12:02 2007 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 1HA1aM-0001BC-3l for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jan 2007 11:12:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HA1aL-0005Tn-Ay for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jan 2007 05:12:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HA1a3-0005Th-4p for help-gnu-emacs@gnu.org; Thu, 25 Jan 2007 05:11:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HA1a0-0005TV-K4 for help-gnu-emacs@gnu.org; Thu, 25 Jan 2007 05:11:41 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HA1a0-0005TQ-AP for help-gnu-emacs@gnu.org; Thu, 25 Jan 2007 05:11:40 -0500 Original-Received: from out4.smtp.messagingengine.com ([66.111.4.28]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HA1a0-0004IK-0k for help-gnu-emacs@gnu.org; Thu, 25 Jan 2007 05:11:40 -0500 Original-Received: from out1.internal (unknown [10.202.2.149]) by out1.messagingengine.com (Postfix) with ESMTP id 167D4953B7 for ; Thu, 25 Jan 2007 05:11:39 -0500 (EST) Original-Received: from web2.messagingengine.com ([10.202.2.211]) by out1.internal (MEProxy); Thu, 25 Jan 2007 05:11:39 -0500 Original-Received: by web2.messagingengine.com (Postfix, from userid 99) id 00DD517EFA; Thu, 25 Jan 2007 05:11:38 -0500 (EST) X-Sasl-Enc: cTmb8z6HREeWKcM4vTho9E2Lrya8wYMCQBCyLG+oGYyM 1169719898 Content-Disposition: inline X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: X-detected-kernel: Windows 2000 SP4, XP SP1+ X-Greylist: delayed 36638 seconds by postgrey-1.27 at monty-python; Thu, 25 Jan 2007 05:11:39 EST 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:40633 Archived-At: Wow, "occur" totally RULES! That's even more than I wanted to achieve! :) Thanks! The problem how to run an arbitrary shell command on the current file -- be it via the text in the buffer or via the filename -- remains. Any ideas on that? On Wed, 24 Jan 2007 21:32:16 -0500, "Barry Margolin" said: > In article , > super-nub wrote: > > > Hi Pete, > > > > for example I want to execute `grep' on my buffer/file to get a survey of the > > section headings in my document (that I keep in a special format for this > > purpose), e.g.: > > > > $ egrep '^\s*-[[:upper:]]+' myfile > > $ -INTRODUCTION > > $ -BLA BLA > > $ -BLA 2 > > $ -MAIN PART > > $ -MISCELLANEOUS > > $ -ETC BLA BLA > > > > shell-command-on-region turned out to be a bit impractical, because I lose my > > current position in the document, as the cursor jumps to the beginning when > > running shell-command-on-region. I guess I would have to write a LISP macro > > to fix that...!? > > The mark-whole-buffer command (C-x h) pushes a mark at the original > location. So after you run shell-command-on-region, you can use C-u > C-space C-u C-space to get back to where you were. > > -- > 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 *** > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs