X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/439f3c3e567692b6823923d569a06ac206d1c3be..00b6647651e4276ac5c47aa33e0fec6726469bc7:/src/editfns.c diff --git a/src/editfns.c b/src/editfns.c index 4c8336b8c8..aed884ebe1 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -5058,6 +5058,14 @@ Transposing beyond buffer boundaries is an error. */) start2_byte, start2_byte + len2_byte); fix_start_end_in_overlays (start1, end2); } + else + { + /* The character positions of the markers remain intact, but we + still need to update their byte positions, because the + transposed regions might include multibyte sequences which + make some original byte positions of the markers invalid. */ + adjust_markers_bytepos (start1, start1_byte, end2, end2_byte, 0); + } signal_after_change (start1, end2 - start1, end2 - start1); return Qnil;