aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa1998-10-24 01:17:09 +0000
committerKenichi Handa1998-10-24 01:17:09 +0000
commit6abb9bd9675dcb89e4f8a0903e7e41eb1eb3e0ec (patch)
tree8c428141b268e1bd6bdff0aaa60a5cbfb59544f1 /src/coding.c
parent9b703a38c632537810ab1cbe1ff93befa17849c7 (diff)
downloademacs-6abb9bd9675dcb89e4f8a0903e7e41eb1eb3e0ec.tar.gz
emacs-6abb9bd9675dcb89e4f8a0903e7e41eb1eb3e0ec.zip
(code_convert_region): While preserving the orignal
point, pay attention to the byte combining problem.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/coding.c b/src/coding.c
index cb6da188de5..6d78aa0d7b9 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -4170,6 +4170,7 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
4170 unsigned char *src, *dst; 4170 unsigned char *src, *dst;
4171 Lisp_Object deletion; 4171 Lisp_Object deletion;
4172 int orig_point = PT, orig_len = len; 4172 int orig_point = PT, orig_len = len;
4173 int prev_Z;
4173 4174
4174 deletion = Qnil; 4175 deletion = Qnil;
4175 saved_coding_symbol = Qnil; 4176 saved_coding_symbol = Qnil;
@@ -4523,7 +4524,9 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
4523 to += tail_skip; to_byte += tail_skip; 4524 to += tail_skip; to_byte += tail_skip;
4524 } 4525 }
4525 4526
4527 prev_Z = Z;
4526 adjust_after_replace (from, from_byte, deletion, inserted, inserted_byte); 4528 adjust_after_replace (from, from_byte, deletion, inserted, inserted_byte);
4529 inserted = Z - prev_Z;
4527 4530
4528 if (! encodep && ! NILP (coding->post_read_conversion)) 4531 if (! encodep && ! NILP (coding->post_read_conversion))
4529 { 4532 {
@@ -4531,12 +4534,10 @@ code_convert_region (from, from_byte, to, to_byte, coding, encodep, replace)
4531 4534
4532 if (from != PT) 4535 if (from != PT)
4533 TEMP_SET_PT_BOTH (from, from_byte); 4536 TEMP_SET_PT_BOTH (from, from_byte);
4537 prev_Z = Z;
4534 val = call1 (coding->post_read_conversion, make_number (inserted)); 4538 val = call1 (coding->post_read_conversion, make_number (inserted));
4535 if (! NILP (val)) 4539 CHECK_NUMBER (val, 0);
4536 { 4540 inserted = Z - prev_Z;
4537 CHECK_NUMBER (val, 0);
4538 inserted = XFASTINT (val);
4539 }
4540 } 4541 }
4541 4542
4542 if (orig_point >= from) 4543 if (orig_point >= from)