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 02:44:42 -0800 (PST)

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"
> <address@hidden> said:
>> In article <address@hidden>,
>>  super-nub <address@hidden> 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, address@hidden
>> 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
>> address@hidden
>> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
> 
> 
> _______________________________________________
> help-gnu-emacs mailing list
> address@hidden
> 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.





reply via email to

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