Subject: re-builder restriction to region

From: Karthik Chikmagalur <[email-masked]>
Date: Tue, 03 Aug 2021 18:28:47 -0700

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