mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-08 12:40:49 -08:00
(verify_overlay_modification):
Copy TAIL before a hook, in case the hook recenters the overlay lists.
This commit is contained in:
parent
37e9a9347d
commit
5fb5aa335e
1 changed files with 31 additions and 6 deletions
37
src/buffer.c
37
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue