all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
To: 49842@debbugs.gnu.org
Subject: bug#49842: re-builder restriction to region
Date: Tue, 03 Aug 2021 18:28:47 -0700	[thread overview]
Message-ID: <877dh23smo.fsf@gmail.com> (raw)
In-Reply-To: <87lf5jqing.fsf@gmail.com>

Hello,

Please disregard this patch. With further testing this does not behave as expected.

re-builder moves the point around in reb-target-buffer with each search, so (region-beginning) has a different meaning every time reb-update-overlays is called. As a result, this fails when, for example, we type in a regexp (in the re-builder buffer), then delete it and type in a new regexp. The new regexp is matched from the location of the first match of the old regexp instead of from the beginning of the region as originally specified by the user.

IIRC, the right way to restrict this to the region would be to define a variable to hold the bounds of the region as specified by the user before starting re-builder and re-search-forward inside those bounds. Perhaps a closure that's tied to the specific re-builder session can be used to avoid issues with the value of this variable when running multiple simultaneous re-builder sessions.

Karthik





  reply	other threads:[~2021-08-04  1:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03  4:03 bug#49842: re-builder restriction to region (lisp/emacs-lisp/re-builder) Karthik Chikmagalur
2021-08-04  1:28 ` Karthik Chikmagalur [this message]
2021-08-04  7:29   ` Lars Ingebrigtsen
2021-08-04 20:59     ` Karthik Chikmagalur
2021-08-05 10:57       ` Lars Ingebrigtsen
2022-08-22 11:01       ` Lars Ingebrigtsen
2022-09-19 19:22         ` Lars Ingebrigtsen

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=877dh23smo.fsf@gmail.com \
    --to=karthikchikmagalur@gmail.com \
    --cc=49842@debbugs.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.