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: Evan Aad
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 16:35:57 +0200

Another solution is to save the position of the point in a register prior
to performing the replacement:

2.5 (Add the following between steps 2 and 3 of the scenario described
in the original question:) C-x r SPC p (This saves the position of the
point in the register p. Any other character can be used in lieu of
'p'.)

4. C-x C-x (This moves the point to the beginning of the region
established in step no. 2.
5. C-SPC (This sets the mark at the position of the point.)
6. C-x r j p (This moves the point to the position saved in the
register 'p'. The region's content is now "BcB".
7. M-x replace-string, B, b. (The buffer's content is now "AbcbD", as desired.)



reply via email to

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