help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Run Shell Command on Buffer


From: super-nub
Subject: Re: Run Shell Command on Buffer
Date: Thu, 25 Jan 2007 00:40:29 +0100
User-agent: Mutt/1.5.11

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 via email to

[Prev in Thread] Current Thread [Next in Thread]