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

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

Re: How to search inside a region that has just been used as the target


From: Anders Munch
Subject: Re: How to search inside a region that has just been used as the target of a replace operation?
Date: Fri, 27 Jan 2023 09:28:07 +0000

Evan Aad wrote:
> I'd like to be able to search inside a region that has just been used as the 
> target of a replace operation, without having to specify explicitly the 
> region's start and end points.

Not a direct answer to your question, but I wonder if you are aware of 
narrow-to-region?

3. C-x n n (narrow-to-region)
4. M-< (beginning-of-buffer, which now goes to the beginning of the narrowed 
region)
5. M-x replace-string C -> c
6. M-<
7. M-x replace-string B -> b
8. C-x n w (widen, undoes the narrowing)

narrow-to-region is disabled by default.  For good reason.  It's very unnerving 
if you invoke it by accident and don't understand what's happening, and 
suddenly most of your file is mysteriously gone (by appearance). 
But it's also extremely useful.

regards, Anders


reply via email to

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