(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.
This commit is contained in:
parent
6cc6455e93
commit
0065621d0d
2 changed files with 2 additions and 1 deletions
|
@ -4091,7 +4091,7 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after,
|
||||||
}
|
}
|
||||||
/* Test for intersecting intervals. This does the right thing
|
/* Test for intersecting intervals. This does the right thing
|
||||||
for both insertion and deletion. */
|
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);
|
Lisp_Object prop = Foverlay_get (overlay, Qmodification_hooks);
|
||||||
if (!NILP (prop))
|
if (!NILP (prop))
|
||||||
|
|
|
@ -142,6 +142,7 @@ properties."
|
||||||
(expected-calls . ((modification-hooks (nil 3 4))
|
(expected-calls . ((modification-hooks (nil 3 4))
|
||||||
(modification-hooks (t 3 4 1)))))
|
(modification-hooks (t 3 4 1)))))
|
||||||
((replace . "4"))
|
((replace . "4"))
|
||||||
|
((replace . "4") (overlay-beg . 4)) ;bug#65929
|
||||||
((replace . "12")
|
((replace . "12")
|
||||||
(expected-calls . ((modification-hooks (nil 1 3))
|
(expected-calls . ((modification-hooks (nil 1 3))
|
||||||
(modification-hooks (t 1 2 2)))))
|
(modification-hooks (t 1 2 2)))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue