Subject: bug#35264: "Match data clobbered by buffer modification hooks" when hooks only shifted match-data's markers

From: Eli Zaretskii <[email-masked]>
Date: Wed, 12 May 2021 17:55:58 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Date: Wed, 12 May 2021 16:35:38 +0200
> Cc: stefan monnier <[email-masked]>, [email-masked]
> 
> Lars Ingebrigtsen <[email-masked]> writes:
> 
> >> But the modification hook in question did call save-match-data.  As far
> >> as I can tell, the problem is that the match-data consists of markers,
> >> whose position gets shifted by deletion of characters.  The check for
> >> this error uses simple integers, so there's no way it can account for
> >> this.
> >
> > That does make sense, but removing this (somewhat buggy) sanity check is
> > perhaps a bit scary.  Any comments on this?
> 
> There were no comments, and the patch no longer applies.  I've respun it
> now for Emacs 28, and this fixes the case reported in this bug report
> (which still reproduces in Emacs 28).
> 
> Any comments?

What about bug#23869, which triggered the addition of that code?