all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: gnuist <gnuist@protonmail.com>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: replace-within-highlighted-region - Is it possible to write? or too hard?
Date: Sun, 21 Jul 2024 01:50:13 +0000	[thread overview]
Message-ID: <w6MI_q3P6hwrvsnaIdkgjs6bqwmA-GhhHwZs2xGV-bSq_hq7HoiHpVEX4gg9UbD6SwKca-bL8ZRzbaKIoL7X57ShgJ9BYJq6DIn--394NJ8=@protonmail.com> (raw)

Hi - I am thinking of a function where you can highlight region, only lets say of one color (ie category) and then be able to replace strings or regexp within those region only.

Functionally, it would be equivalent to narrowing to multiple regions all at once, based on a regexp and highlighting those regions.

In my previous posts on ediff-buffers, I was thinking that #f or focus provided such a functionality within each active region and REFINED to it as the new active region within what was highlighted before it.

In addition, I was thinking that #h provided a functionality whereby you would be able to ignore those regions (ie matched strings) that would be masked.

The problem with narrow-to-region is that undoing is harder of a macro, whereas replace can be undone with a single undo.

As it is, the current #f is almost equivalent to show-lines-matching-regexp and #h is almost equivalent to hide-lines-matching-regexp.

Tx



             reply	other threads:[~2024-07-21  1:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-21  1:50 gnuist [this message]
2024-07-21 12:57 ` replace-within-highlighted-region - Is it possible to write? or too hard? Michael Heerdegen via Users list for the GNU Emacs text editor
2024-07-21 16:55   ` [External] : " Drew Adams
2024-07-21 16:47 ` [External] : " Drew Adams

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='w6MI_q3P6hwrvsnaIdkgjs6bqwmA-GhhHwZs2xGV-bSq_hq7HoiHpVEX4gg9UbD6SwKca-bL8ZRzbaKIoL7X57ShgJ9BYJq6DIn--394NJ8=@protonmail.com' \
    --to=gnuist@protonmail.com \
    --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.