Subject: bug#73018: 31.0.50; wdired + replace-regexp only modifies the visible portion of the buffer

From: Stefan Monnier <[email-masked]>
Date: Tue, 17 Sep 2024 14:57:29 -0400

> Do you have an explanation for why this should make a difference?

The bug shows up if the `search_regs.start/end` happen to be resized
(grown) during the modification hooks (and only if that happens when
running those hooks inside `replace_match`).

Those arrays are resized only when we use a regexp that has more groups
than the "largest" regexp we've encountered so far.  So the problem
disappears as soon as we use the "largest" regexp time before we use it
from within a change hook run from within `replace_match`.

        Stefan