GNU bug report logs -
#73018
31.0.50; wdired + replace-regexp only modifies the visible portion of the buffer
Previous Next
Reported by: Madhu <enometh <at> meer.net>
Date: Wed, 4 Sep 2024 02:38:01 UTC
Severity: normal
Found in version 31.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, Madhu <enometh <at> meer.net>,
> 73018 <at> debbugs.gnu.org
> Date: Tue, 10 Sep 2024 09:27:31 -0400
> From: Stefan Monnier via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>
> > We should probably use something like
> >
> > ptrdiff_t
> > search_regs_last_reg (void)
> > {
> > ptrdiff_t i = search_regs.num_regs - 1;
> > while (i >= 0 && search_regs.start[i] < 0)
> > i--;
> > return i;
> > }
> >
> > instead of `search_regs.num_regs`.
>
> And maybe we should consider changing `struct re_search` to keep track
> of the last non-nil subgroup. Currently, things like `match-data` loop
> through all the elements of `search_regs` whose size depends on the
> size (in number of subgroups) of the largest regexp we have ever matched
> so far, rather than the actual number of subgroups currently in use, so
> there's some wasted work there. Maybe the cost of maintaining the "last
> reg" would pay off.
Since this is a regression in Emacs 30, I'd like to solve it on the
release branch. Can you suggest the safest fix you can come up with
for that purpose?
TIA
This bug report was last modified 295 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.