# HG changeset patch # User Richard M. Stallman # Date 919316434 0 # Node ID 39caae99e25d4d68e436e0a926316891e78c2d37 # Parent 9028f3cd0a5e15d4a4c69b3089f300a31dc26e50 (adjust_markers_for_replace): When doing an insertion (replacing a region of zero length), handle markers at the insertion point properly. diff -r 9028f3cd0a5e -r 39caae99e25d src/insdel.c --- a/src/insdel.c Thu Feb 18 01:10:46 1999 +0000 +++ b/src/insdel.c Thu Feb 18 05:40:34 1999 +0000 @@ -578,7 +578,12 @@ { register struct Lisp_Marker *m = XMARKER (marker); - if (m->bytepos >= prev_to_byte) + if (m->bytepos >= prev_to_byte + && (old_bytes != 0 + /* If this is an insertion (replacing 0 chars), + reject the case of a marker that is at the + insertion point and should stay before the insertion. */ + || m->bytepos > from_byte || m->insertion_type)) { if (m->bytepos < prev_to_byte + combined_after_bytes) {