From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: super-nub Newsgroups: gmane.emacs.help Subject: Re: Run Shell Command on Buffer Date: Thu, 25 Jan 2007 02:44:42 -0800 (PST) Message-ID: <8599699.post@talk.nabble.com> References: <8572445.post@talk.nabble.com> <1169719898.5250.1171149107@webmail.messagingengine.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1169721909 17434 80.91.229.12 (25 Jan 2007 10:45:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Jan 2007 10:45:09 +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:45:01 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 1HA26F-0008Pp-Rr for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jan 2007 11:45:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HA26F-0003uN-Ea for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jan 2007 05:44:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HA262-0003u8-VW for help-gnu-emacs@gnu.org; Thu, 25 Jan 2007 05:44:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HA260-0003tw-N3 for Help-gnu-emacs@gnu.org; Thu, 25 Jan 2007 05:44:45 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HA260-0003tt-KH for Help-gnu-emacs@gnu.org; Thu, 25 Jan 2007 05:44:44 -0500 Original-Received: from www.nabble.com ([72.21.53.35] helo=talk.nabble.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HA260-0002u7-82 for Help-gnu-emacs@gnu.org; Thu, 25 Jan 2007 05:44:44 -0500 Original-Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1HA25y-0002yB-QN for Help-gnu-emacs@gnu.org; Thu, 25 Jan 2007 02:44:42 -0800 In-Reply-To: <1169719898.5250.1171149107@webmail.messagingengine.com> X-Nabble-From: scame@fastmail.fm X-detected-kernel: Linux 2.4-2.6 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:40634 Archived-At: Whoops, sorry, replied to the wrong post... C-u C-space is also quite handy, I will try to write a macro that automates eveything, thx! super-nub wrote: > > 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 > > > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs > > -- View this message in context: http://www.nabble.com/Run-Shell-Command-on-Buffer-tf3084566.html#a8599699 Sent from the Emacs - Help mailing list archive at Nabble.com.