unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: super-nub <scame@fastmail.fm>
To: Help-gnu-emacs@gnu.org
Subject: Re: Run Shell Command on Buffer
Date: Thu, 25 Jan 2007 00:40:29 +0100	[thread overview]
Message-ID: <20070124234028.GA15247@fastmail.fm> (raw)
In-Reply-To: <DF95C12E-B410-4877-BA85-004A66FFC033@Web.DE>

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...!?

Regards,
super-nub

On Wed, Jan 24, 2007 at 10:24:30PM +0100, Peter Dyballa wrote:
> 
> Am 24.01.2007 um 22:02 schrieb super-nub:
> 
> >1) Is it possible to run `shell-command' <some command> <RET> on  
> >the current
> >buffer? Or is there a shortcut to the file name of the current  
> >buffer, so
> >that I would type e.g. `ls -l %' as a command and % is replaced by  
> >the name
> >of the current file?
> 
> Have you checked shell-command-on-region?
> 
> What do you want to achieve?
> 
> --
> Greetings
> 
>   Pete
> 
> ’Twas a woman who drove me to drink, and I never had the courtesy
>  to thank her for it.         — W.C. Fields
> 
> 

  reply	other threads:[~2007-01-24 23:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-24 21:02 Run Shell Command on Buffer super-nub
2007-01-24 21:24 ` Peter Dyballa
2007-01-24 23:40   ` super-nub [this message]
2007-01-25  6:47     ` reader
2007-01-25 10:52       ` super-nub
2007-01-25 15:45         ` Drew Adams
     [not found]   ` <mailman.3545.1169683280.2155.help-gnu-emacs@gnu.org>
2007-01-25  2:32     ` Barry Margolin
2007-01-25 10:11       ` scame
2007-01-25 10:44         ` super-nub
     [not found] <mailman.3538.1169672554.2155.help-gnu-emacs@gnu.org>
2007-01-24 21:58 ` Marc Tfardy
2007-01-25  0:01   ` scame
     [not found] <mailman.3575.1169739977.2155.help-gnu-emacs@gnu.org>
2007-01-25 20:11 ` Ted Zlatanov
2007-01-25 21:04   ` Drew Adams
     [not found] <mailman.3595.1169759151.2155.help-gnu-emacs@gnu.org>
2007-01-26 15:57 ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070124234028.GA15247@fastmail.fm \
    --to=scame@fastmail.fm \
    --cc=Help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).