aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fns.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/fns.c b/src/fns.c
index c60303acec6..0c24f7a4e3f 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2990,15 +2990,20 @@ If the region can't be decoded, return nil and don't modify the buffer.")
2990 and delete the old. (Insert first in order to preserve markers.) */ 2990 and delete the old. (Insert first in order to preserve markers.) */
2991 /* We insert two spaces, then insert the decoded text in between 2991 /* We insert two spaces, then insert the decoded text in between
2992 them, at last, delete those extra two spaces. This is to avoid 2992 them, at last, delete those extra two spaces. This is to avoid
2993 byte combining. */ 2993 byte combining while inserting. */
2994 TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg); 2994 TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg);
2995 insert_1_both (" ", 2, 2, 0, 1, 0); 2995 insert_1_both (" ", 2, 2, 0, 1, 0);
2996 TEMP_SET_PT_BOTH (XFASTINT (beg) + 1, ibeg + 1); 2996 TEMP_SET_PT_BOTH (XFASTINT (beg) + 1, ibeg + 1);
2997 insert (decoded, decoded_length); 2997 insert (decoded, decoded_length);
2998 inserted_chars = PT - (XFASTINT (beg) + 1); 2998 inserted_chars = PT - (XFASTINT (beg) + 1);
2999 del_range_both (PT, PT_BYTE, XFASTINT (end) + inserted_chars + 2, 2999 /* At first delete the original text. This never cause byte
3000 combining. */
3001 del_range_both (PT + 1, PT_BYTE + 1, XFASTINT (end) + inserted_chars + 2,
3000 iend + decoded_length + 2, 1); 3002 iend + decoded_length + 2, 1);
3001 del_range_both (XFASTINT (beg), ibeg, XFASTINT (beg) + 1, ibeg + 1, 1); 3003 /* Next delete the extra spaces. This will cause byte combining
3004 error. */
3005 del_range_both (PT, PT_BYTE, PT + 1, PT_BYTE + 1, 0);
3006 del_range_both (XFASTINT (beg), ibeg, XFASTINT (beg) + 1, ibeg + 1, 0);
3002 inserted_chars = PT - XFASTINT (beg); 3007 inserted_chars = PT - XFASTINT (beg);
3003 3008
3004 /* If point was outside of the region, restore it exactly; else just 3009 /* If point was outside of the region, restore it exactly; else just