all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Anders Munch <ajm@flonidan.dk>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
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	[thread overview]
Message-ID: <HE1PR0502MB30040A21897B84BD0889D735B4CC9@HE1PR0502MB3004.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <CA+-Lr-Csosdunv5XdJk+2z4TxpmKVzan+7RkTBZ66r7LRn=20A@mail.gmail.com>

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	other threads:[~2023-01-27  9:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27  8:55 How to search inside a region that has just been used as the target of a replace operation? Evan Aad
2023-01-27  9:28 ` Anders Munch [this message]
2023-01-27 10:44   ` Evan Aad
2023-01-27 14:35     ` Evan Aad
2023-01-27 18:11     ` Marcin Borkowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=HE1PR0502MB30040A21897B84BD0889D735B4CC9@HE1PR0502MB3004.eurprd05.prod.outlook.com \
    --to=ajm@flonidan.dk \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.