From 2db5082ff442ba59a7cbc572143910aa5d845f88 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 21 Mar 1998 05:48:03 +0000 Subject: [PATCH] (replace_range): New arg NOMARKERS. --- src/insdel.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/insdel.c b/src/insdel.c index 3c76f3255dc..e2223f1b4f7 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1492,9 +1492,9 @@ adjust_after_replace (from, from_byte, to, to_byte, len, len_byte, replace) That way, undo will also handle markers properly. */ void -replace_range (from, to, new, prepare, inherit) +replace_range (from, to, new, prepare, inherit, nomarkers) Lisp_Object new; - int from, to, prepare, inherit; + int from, to, prepare, inherit, nomarkers; { int inschars = XSTRING (new)->size; int insbytes = XSTRING (new)->size_byte; @@ -1558,11 +1558,12 @@ replace_range (from, to, new, prepare, inherit) deletion = make_buffer_string_both (from, from_byte, to, to_byte, 1); - /* Relocate all markers pointing into the new, larger gap - to point at the end of the text before the gap. - Do this before recording the deletion, - so that undo handles this after reinserting the text. */ - adjust_markers_for_delete (from, from_byte, to, to_byte); + if (nomarkers) + /* Relocate all markers pointing into the new, larger gap + to point at the end of the text before the gap. + Do this before recording the deletion, + so that undo handles this after reinserting the text. */ + adjust_markers_for_delete (from, from_byte, to, to_byte); record_delete (from, deletion); @@ -1658,9 +1659,10 @@ replace_range (from, to, new, prepare, inherit) adjusting the markers that bound the overlays. */ adjust_overlays_for_delete (from, nchars_del); adjust_overlays_for_insert (from, inschars); - adjust_markers_for_insert (from, from_byte, - from + inschars, from_byte + outgoing_insbytes, - combined_before_bytes, combined_after_bytes, 0); + if (nomarkers) + adjust_markers_for_insert (from, from_byte, + from + inschars, from_byte + outgoing_insbytes, + combined_before_bytes, combined_after_bytes, 0); #ifdef USE_TEXT_PROPERTIES offset_intervals (current_buffer, PT, inschars - nchars_del); -- 2.39.5