changeset 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 0154f51c56d8
children 84ad9e201361
files src/coding.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/coding.c	Sat Oct 24 01:17:09 1998 +0000
+++ b/src/coding.c	Sat Oct 24 01:17:09 1998 +0000
@@ -4170,6 +4170,7 @@
   unsigned char *src, *dst;
   Lisp_Object deletion;
   int orig_point = PT, orig_len = len;
+  int prev_Z;
 
   deletion = Qnil;
   saved_coding_symbol = Qnil;
@@ -4523,7 +4524,9 @@
       to += tail_skip; to_byte += tail_skip;
     }
 
+  prev_Z = Z;
   adjust_after_replace (from, from_byte, deletion, inserted, inserted_byte);
+  inserted = Z - prev_Z;
 
   if (! encodep && ! NILP (coding->post_read_conversion))
     {
@@ -4531,12 +4534,10 @@
 
       if (from != PT)
 	TEMP_SET_PT_BOTH (from, from_byte);
+      prev_Z = Z;
       val = call1 (coding->post_read_conversion, make_number (inserted));
-      if (! NILP (val))
-	{
-	  CHECK_NUMBER (val, 0);
-	  inserted = XFASTINT (val);
-	}
+      CHECK_NUMBER (val, 0);
+      inserted = Z - prev_Z;
     }
 
   if (orig_point >= from)