comparison src/fileio.c @ 21319:4f8b7860819e

(Finsert_file_contents): Call adjust_after_insert when a text is inserted in a multibyte buffer without any code conversion.
author Kenichi Handa <handa@m17n.org>
date Mon, 30 Mar 1998 06:00:54 +0000
parents 1c2b68b607c8
children f866f7cadda2
comparison
equal deleted inserted replaced
21318:dd41afae56a4 21319:4f8b7860819e
3791 int inserted_byte = inserted; 3791 int inserted_byte = inserted;
3792 3792
3793 /* There's a possibility that we must combine bytes at the 3793 /* There's a possibility that we must combine bytes at the
3794 head (resp. the tail) of the just inserted text with the 3794 head (resp. the tail) of the just inserted text with the
3795 bytes before (resp. after) the gap to form a single 3795 bytes before (resp. after) the gap to form a single
3796 character. Thus, we, at first, rewind the adjusted 3796 character. */
3797 character positions (GPT, ZV, Z), then adjust them again. */ 3797 inserted = multibyte_chars_in_text (GPT_ADDR - inserted, inserted);
3798 GAP_SIZE += inserted; 3798 adjust_after_insert (PT, PT_BYTE,
3799 GPT_BYTE -= inserted; 3799 PT + inserted_byte, PT_BYTE + inserted_byte,
3800 ZV_BYTE -= inserted; 3800 inserted);
3801 Z_BYTE -= inserted;
3802 GPT -= inserted;
3803 ZV -= inserted;
3804 Z -= inserted;
3805
3806 inserted = multibyte_chars_in_text (GPT_ADDR, inserted);
3807 adjust_after_replace (PT, PT_BYTE, PT, PT_BYTE,
3808 inserted, inserted_byte, 0);
3809 } 3801 }
3810 3802
3811 #ifdef DOS_NT 3803 #ifdef DOS_NT
3812 /* Use the conversion type to determine buffer-file-type 3804 /* Use the conversion type to determine buffer-file-type
3813 (find-buffer-file-type is now used to help determine the 3805 (find-buffer-file-type is now used to help determine the