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: Run Shell Command on Buffer Date: Wed, 24 Jan 2007 21:32:16 -0500 Organization: Symantec Message-ID: References: <8572445.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1169692836 3213 80.91.229.12 (25 Jan 2007 02:40:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Jan 2007 02:40:36 +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 03:40:34 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 1H9uXR-0000rJ-UT for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jan 2007 03:40:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H9uXQ-0008Ro-Qb for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jan 2007 21:40:32 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Wed, 24 Jan 2007 20:32:16 -0600 Original-Newsgroups: gnu.emacs.help Mail-Copies-To: nobody User-Agent: MT-NewsWatcher/3.5.2 (PPC Mac OS X) X-Copies-To: never Original-Lines: 31 Original-NNTP-Posting-Host: 24.34.108.171 Original-X-Trace: sv3-AjRHLzhX9x6gPoLIa4R7M9G6XMqKD12MaJ3nt+nVDw3gL2laOkTV5pPhyE8FTvdSfLIP15b1svPhwFZ!7Yq2+HDuBBYIF1ZQxkqRzFIn5pZLg7t82F8mWP8Yzqh5K6p9XUVVMPnjSXL9dHriB0ixRe0hTqfy!5HEECxmg0QFU+boJy66tcm70/030iPFBWg== 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.32 Original-Xref: shelby.stanford.edu gnu.emacs.help:145021 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:40624 Archived-At: 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 ***