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 00:40:29 +0100 Message-ID: <20070124234028.GA15247@fastmail.fm> References: <8572445.post@talk.nabble.com> Reply-To: super-nub NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1169683299 7069 80.91.229.12 (25 Jan 2007 00:01:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Jan 2007 00:01:39 +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 01:01:32 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 1H9s3X-0005bf-NL for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Jan 2007 01:01:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H9s3X-0004rq-4r for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Jan 2007 19:01:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H9s3K-0004pv-Va for help-gnu-emacs@gnu.org; Wed, 24 Jan 2007 19:01:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H9s3J-0004mZ-9A for Help-gnu-emacs@gnu.org; Wed, 24 Jan 2007 19:01:18 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H9s3J-0004mO-30 for Help-gnu-emacs@gnu.org; Wed, 24 Jan 2007 19:01:17 -0500 Original-Received: from out4.smtp.messagingengine.com ([66.111.4.28]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H9s3H-0006F7-HC for Help-gnu-emacs@gnu.org; Wed, 24 Jan 2007 19:01:16 -0500 Original-Received: from out1.internal (unknown [10.202.2.149]) by out1.messagingengine.com (Postfix) with ESMTP id 83AC995E67 for ; Wed, 24 Jan 2007 18:39:45 -0500 (EST) Original-Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by out1.internal (MEProxy); Wed, 24 Jan 2007 18:39:45 -0500 X-Sasl-enc: Dkba+iy6Wz+v0C9jKEIMX+wVbi658AnZGHWlXbstIWvb 1169681985 Original-Received: from [127.0.0.1] (unknown [62.206.18.218]) by mail.messagingengine.com (Postfix) with ESMTP id 17B64B970 for ; Wed, 24 Jan 2007 18:39:44 -0500 (EST) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:40618 Archived-At: 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 los= e my current position in the document, as the cursor jumps to the beginni= ng when running shell-command-on-region. I guess I would have to write a = LISP macro to fix that...!? Regards, super-nub On Wed, Jan 24, 2007 at 10:24:30PM +0100, Peter Dyballa wrote: >=20 > Am 24.01.2007 um 22:02 schrieb super-nub: >=20 > >1) Is it possible to run `shell-command' on =20 > >the current > >buffer? Or is there a shortcut to the file name of the current =20 > >buffer, so > >that I would type e.g. `ls -l %' as a command and % is replaced by =20 > >the name > >of the current file? >=20 > Have you checked shell-command-on-region? >=20 > What do you want to achieve? >=20 > -- > Greetings >=20 > Pete >=20 > =E2=80=99Twas a woman who drove me to drink, and I never had the courte= sy > to thank her for it. =E2=80=94 W.C. Fields >=20 >=20