Subject: bug#78221: 31.0.50; Improving *-change-functions notifications

From: Eli Zaretskii <[email-masked]>
Date: Sat, 03 May 2025 18:52:11 +0300

> Date: Sat, 3 May 2025 15:15:24 +0000
> Cc: [email-masked], [email-masked], [email-masked],
>   [email-masked]
> From: Alan Mackenzie <[email-masked]>
> 
> > That's not how nested notifications happen in most, if not all, the
> > cases.  They happen because a function that calls the before-change at
> > the beginning and an after-change at the end calls, as part of its
> > processing, some other function, which itself modifies buffer text or
> > the text properties, and thus emits its own "nested" notifications.
> 
> OK.  Most Lisp code shouldn't be running the hook explicitly,
> though.

No, but the C code does.  And it's very easy to imagine a situation
where one such primitive is invoked in the middle of another.  A case
in point is coding.c, where Stefan eliminated such a "nesting" just a
few hours ago (by a change that we have yet to see if it's safe).
With all the hooks we provide, such situations can emerge very easily.