comparison src/coding.c @ 23537:28cd5faf93dd

(code_convert_region): While preserving the orignal point, pay attention to the byte combining problem.
author Kenichi Handa <handa@m17n.org>
date Sat, 24 Oct 1998 01:17:09 +0000
parents 7bad909cd6f1
children eaf358b2e8dd
comparison
equal deleted inserted replaced
23536:0154f51c56d8 23537:28cd5faf93dd
4168 int first = 1; 4168 int first = 1;
4169 int fake_multibyte = 0; 4169 int fake_multibyte = 0;
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;
4176 4177
4177 if (from < PT && PT < to) 4178 if (from < PT && PT < to)
4521 Z -= total_skip; Z_BYTE -= total_skip; 4522 Z -= total_skip; Z_BYTE -= total_skip;
4522 from -= head_skip; from_byte -= head_skip; 4523 from -= head_skip; from_byte -= head_skip;
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 {
4530 Lisp_Object val; 4533 Lisp_Object val;
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)
4543 { 4544 {
4544 if (orig_point >= from + orig_len) 4545 if (orig_point >= from + orig_len)