From 0065621d0d36112922792d7c46085230e999cba3 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 13 Sep 2023 18:49:55 -0400 Subject: (report_overlay_modification): Fix bug#65929 Somehow the new overlay code in Emacs-29 changed slightly the test to decide when to run the `modification-hooks` of overlays, with the consequence that these hook functions end up being executed also when text is deleted right after an empty overlay, which is contrary to Emacs-28 behavior as well as contrary to the Texinfo doc. * src/buffer.c (report_overlay_modification): Better reproduce the Emacs-28 code. * test/src/buffer-tests.el (overlay-modification-hooks): Add corresponding test. --- src/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/buffer.c') diff --git a/src/buffer.c b/src/buffer.c index 252231357bc..db362ffe7b0 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4091,7 +4091,7 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, } /* Test for intersecting intervals. This does the right thing for both insertion and deletion. */ - if (! insertion || (end_arg > obegin && begin_arg < oend)) + if (end_arg > obegin && begin_arg < oend) { Lisp_Object prop = Foverlay_get (overlay, Qmodification_hooks); if (!NILP (prop)) -- cgit v1.2.1