aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1998-03-30 06:00:54 +0000
committerKenichi Handa1998-03-30 06:00:54 +0000
commit12fccb8562771042b49373c30782297caf2f4eb4 (patch)
tree7f8312750b1ad3e31aecbe453ccb8fdee6ad46a9 /src
parent5c5f75f13161ef3de0945a4028fe00f8e5d33583 (diff)
downloademacs-12fccb8562771042b49373c30782297caf2f4eb4.tar.gz
emacs-12fccb8562771042b49373c30782297caf2f4eb4.zip
(Finsert_file_contents): Call adjust_after_insert when
a text is inserted in a multibyte buffer without any code conversion.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 677bb9be7a8..fbb6e64f2d1 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3793,19 +3793,11 @@ This does code conversion according to the value of\n\
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