From: Richard M. Stallman Date: Wed, 30 Mar 1994 06:32:54 +0000 (+0000) Subject: (verify_overlay_modification): X-Git-Tag: emacs-19.34~9261 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5fb5aa335ec035d80fd22a08fac3035e0e65da77;p=emacs.git (verify_overlay_modification): Copy TAIL before a hook, in case the hook recenters the overlay lists. --- diff --git a/src/buffer.c b/src/buffer.c index b76a024cd32..ed8c3518644 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2044,19 +2044,32 @@ verify_overlay_modification (start, end) 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 @@ verify_overlay_modification (start, end) 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); + } } } }