summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fns.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fns.c b/src/fns.c
index 22c9ac41d1f..c60303acec6 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2839,7 +2839,7 @@ into shorter lines.")
/* Now we have encoded the region, so we insert the new contents
and delete the old. (Insert first in order to preserve markers.) */
- SET_PT (beg);
+ SET_PT_BOTH (XFASTINT (beg), ibeg);
insert (encoded, encoded_length);
del_range_byte (ibeg + encoded_length, iend + encoded_length, 1);
@@ -2847,8 +2847,8 @@ into shorter lines.")
move to the beginning of the region. */
if (old_pos >= XFASTINT (end))
old_pos += encoded_length - (XFASTINT (end) - XFASTINT (beg));
- else if (old_pos > beg)
- old_pos = beg;
+ else if (old_pos > XFASTINT (beg))
+ old_pos = XFASTINT (beg);
SET_PT (old_pos);
/* We return the length of the encoded text. */