# HG changeset patch # User Richard M. Stallman # Date 765009174 0 # Node ID 60f70854e73fd41a306d52c24a1d11224fbe44f3 # Parent 2c66255e9469dad076cd3667a7f8aefe87293dd0 (verify_overlay_modification): Copy TAIL before a hook, in case the hook recenters the overlay lists. diff -r 2c66255e9469 -r 60f70854e73f src/buffer.c --- a/src/buffer.c Wed Mar 30 05:23:18 1994 +0000 +++ b/src/buffer.c Wed Mar 30 06:32:54 1994 +0000 @@ -2044,19 +2044,32 @@ if (XFASTINT (end) == startpos && insertion) { prop = Foverlay_get (overlay, Qinsert_in_front_hooks); - call_overlay_mod_hooks (prop, overlay, start, end); + if (!NILP (prop)) + { + /* Copy TAIL in case the hook recenters the overlay lists. */ + tail = Fcopy_sequence (tail); + call_overlay_mod_hooks (prop, overlay, start, end); + } } if (XFASTINT (start) == endpos && insertion) { prop = Foverlay_get (overlay, Qinsert_behind_hooks); - call_overlay_mod_hooks (prop, overlay, start, end); + if (!NILP (prop)) + { + tail = Fcopy_sequence (tail); + call_overlay_mod_hooks (prop, overlay, start, end); + } } if (insertion ? (XFASTINT (start) > startpos && XFASTINT (end) < endpos) : (XFASTINT (start) >= startpos && XFASTINT (end) <= endpos)) { prop = Foverlay_get (overlay, Qmodification_hooks); - call_overlay_mod_hooks (prop, overlay, start, end); + if (!NILP (prop)) + { + tail = Fcopy_sequence (tail); + call_overlay_mod_hooks (prop, overlay, start, end); + } } } @@ -2078,19 +2091,31 @@ if (XFASTINT (end) == startpos && insertion) { prop = Foverlay_get (overlay, Qinsert_in_front_hooks); - call_overlay_mod_hooks (prop, overlay, start, end); + if (!NILP (prop)) + { + tail = Fcopy_sequence (tail); + call_overlay_mod_hooks (prop, overlay, start, end); + } } if (XFASTINT (start) == endpos && insertion) { prop = Foverlay_get (overlay, Qinsert_behind_hooks); - call_overlay_mod_hooks (prop, overlay, start, end); + if (!NILP (prop)) + { + tail = Fcopy_sequence (tail); + call_overlay_mod_hooks (prop, overlay, start, end); + } } if (insertion ? (XFASTINT (start) > startpos && XFASTINT (end) < endpos) : (XFASTINT (start) >= startpos && XFASTINT (end) <= endpos)) { prop = Foverlay_get (overlay, Qmodification_hooks); - call_overlay_mod_hooks (prop, overlay, start, end); + if (!NILP (prop)) + { + tail = Fcopy_sequence (tail); + call_overlay_mod_hooks (prop, overlay, start, end); + } } } }