Subject: bug#30823: 25.3; modification-hooks of overlays are not run in some cases

From: Noam Postavsky <[email-masked]>
Date: Wed, 12 Sep 2018 21:34:37 -0400

Eli Zaretskii <[email-masked]> writes:

> No, the protection was meant to be more general: to avoid calling
> overlay modification hooks when the overlay in question is from the
> wrong buffer.

Ah, well I see your new patch fulfills this mission better (the old one
only looked the first overlay, so it seemed rather specific to
bug#21824).

> I'm not opposed to making the change you suggested for xdisp.c
> (although maybe it should go to master, not to emacs-26), but I would
> like to keep the protection in buffer.c.

Funny, I feel the same but in reverse.  Your patch should only affect
the case where overlays are deleted/moved by modification hooks which is
already a grey area, so the change is *probably* okay; but I would put
it in master in case of unforseen side effects.

> With that in mind, WDYT about the patch below, which replaces the
> buffer.c portion of your patch?  I've ran the tests for both bug#21824
> and for this bug, and they both pass with the patch installed and with
> unmodified xdisp.c.

I can confirm it works, and the change seems generally sensible.  I
think it does make sense to have the xdisp.c change as well.  The choice
of branch is up to you, of course.