summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-03-30 06:32:54 +0000
committerRichard M. Stallman <rms@gnu.org>1994-03-30 06:32:54 +0000
commit09131825716c1df0873b97a6e8d3dca9affa70e8 (patch)
tree3157ce416d89a94fd9f9dce11021f893676047aa /src/buffer.c
parentd764407ce34a511abab8b700c080042538c11d87 (diff)
downloademacs-09131825716c1df0873b97a6e8d3dca9affa70e8.tar.gz
(verify_overlay_modification):
Copy TAIL before a hook, in case the hook recenters the overlay lists.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c37
1 files changed, 31 insertions, 6 deletions
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);
+ }
}
}
}