summaryrefslogtreecommitdiff
path: root/src/insdel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/insdel.c')
-rw-r--r--src/insdel.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 02e3f41bc9f..697395c507b 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -2148,10 +2148,13 @@ signal_before_change (ptrdiff_t start_int, ptrdiff_t end_int,
FETCH_START, FETCH_END, Qnil);
}
+ /* Detach the markers now that we're done with them. Don't directly
+ free them, since the change functions could have caused them to
+ be inserted into the undo list (Bug#30931). */
if (! NILP (start_marker))
- free_marker (start_marker);
+ Fset_marker (start_marker, Qnil, Qnil);
if (! NILP (end_marker))
- free_marker (end_marker);
+ Fset_marker (end_marker, Qnil, Qnil);
RESTORE_VALUE;
unbind_to (count, Qnil);