# HG changeset patch # User Richard M. Stallman # Date 890459283 0 # Node ID 81154898ac20373b94631cc611664d249f06c668 # Parent 8c727c9f1e919df5e0f905728abbde5a9f7a4ae0 (replace_range): New arg NOMARKERS. diff -r 8c727c9f1e91 -r 81154898ac20 src/insdel.c --- a/src/insdel.c Sat Mar 21 04:45:12 1998 +0000 +++ b/src/insdel.c Sat Mar 21 05:48:03 1998 +0000 @@ -1492,9 +1492,9 @@ 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 @@ 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 @@ 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);