]> git.eshelyaron.com Git - emacs.git/commitdiff
(Finsert_file_contents): Call adjust_after_insert when
authorKenichi Handa <handa@m17n.org>
Mon, 30 Mar 1998 06:00:54 +0000 (06:00 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 30 Mar 1998 06:00:54 +0000 (06:00 +0000)
a text is inserted in a multibyte buffer without any code
conversion.

src/fileio.c

index 677bb9be7a8120f38f24ba89454666ba1bc178bb..fbb6e64f2d12aad8499eb8c55be60d0f9bfbdeb5 100644 (file)
@@ -3793,19 +3793,11 @@ This does code conversion according to the value of\n\
          /* There's a possibility that we must combine bytes at the
             head (resp. the tail) of the just inserted text with the
             bytes before (resp. after) the gap to form a single
-            character.  Thus, we, at first, rewind the adjusted
-            character positions (GPT, ZV, Z), then adjust them again.  */
-         GAP_SIZE += inserted;
-         GPT_BYTE -= inserted;
-         ZV_BYTE -= inserted;
-         Z_BYTE -= inserted;
-         GPT -= inserted;
-         ZV -= inserted;
-         Z -= inserted;
-
-         inserted = multibyte_chars_in_text (GPT_ADDR, inserted);
-         adjust_after_replace (PT, PT_BYTE, PT, PT_BYTE,
-                               inserted, inserted_byte, 0);
+            character.  */
+         inserted = multibyte_chars_in_text (GPT_ADDR - inserted, inserted);
+         adjust_after_insert (PT, PT_BYTE,
+                              PT + inserted_byte, PT_BYTE + inserted_byte,
+                              inserted);
        }
 
 #ifdef DOS_NT