Subject: Re: bug#78042: 31.0.50; Improper sequence of `before/after-change-functions` calls

From: Stefan Monnier <[email-masked]>
Date: Sat, 26 Apr 2025 19:22:42 -0400

>> The problem is that it would change the semantics of
>> `after/before-change-functions`.  E.g. code that needs to match the
>> before with the after (e.g. CC-mode, Eglot, ...) would now need to be
>> adjusted to keep a stack of "pending befores" and the C code would need
>> to be reviewed to try and catch the few places where we currently run
>> `after-change-functions` several times after running
>> `before-change-functions` once.
>> 
>> IOW, we'd trade one set of corner-case breakage for another.
>
> Except that making us prepared to handle nested notifications will
> solve the problem for good.

I don't see why it'll be easier to find all the cases where we currently
call `after-change-functions` several times.

But maybe you're right.  It'll still be a breaking change, so it might
require introducing new hooks to replace
`after/before-change-functions`.  In the mean time, I'll keep fixing the
problems I bump into.

        Stefan