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

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

Re: Operations on a region


From: Barry Margolin
Subject: Re: Operations on a region
Date: Fri, 22 Nov 2002 16:43:00 GMT

In article <arlkg2$bge$1@ausnews.austin.ibm.com>,
Arnold  <oscar@trashcan.com> wrote:
>Hi,
>I'm a vi user trying to learn emacs.  In vi, I could very easily mark a 
>region and do an operation on it.  e.g. :'a,'bs/blah/word/'  or 
>:'a,'b!sort.  So far, the closest I've seen is to mark a region and then 
>narrow into it, but that's not as easy as on vi and it I can't run a 
>command on it and have the output replace that contents of that region.

C-u M-| 

will prompt for a shell command, pipe the region to it, and replace the
region with the output.

>Lisp is also new to me, but I'm thinking of trying to craft a script 
>that will automatically narrow in, prompt me for the search-replace 
>stuff, and then automatically widen back out.

If you enable transient-mark-mode, many commands that normally work on the
entire buffer automatically restrict themselves to the region when it's
highlighted.

-- 
Barry Margolin, barmar@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


reply via email to

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