diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/fileio.c b/src/fileio.c index 4006bf839aa..7def34b7dcb 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3776,6 +3776,25 @@ This does code conversion according to the value of\n\ | |||
| 3776 | inserted = (NILP (current_buffer->enable_multibyte_characters) | 3776 | inserted = (NILP (current_buffer->enable_multibyte_characters) |
| 3777 | ? coding.produced : coding.produced_char); | 3777 | ? coding.produced : coding.produced_char); |
| 3778 | } | 3778 | } |
| 3779 | else if (!NILP (current_buffer->enable_multibyte_characters)) | ||
| 3780 | { | ||
| 3781 | int inserted_byte = inserted; | ||
| 3782 | |||
| 3783 | /* At first, reset positions to the state of before | ||
| 3784 | insertion. */ | ||
| 3785 | GAP_SIZE += inserted; | ||
| 3786 | GPT_BYTE -= inserted; | ||
| 3787 | ZV_BYTE -= inserted; | ||
| 3788 | Z_BYTE -= inserted; | ||
| 3789 | GPT -= inserted; | ||
| 3790 | ZV -= inserted; | ||
| 3791 | Z -= inserted; | ||
| 3792 | |||
| 3793 | /* Then adjust positions. */ | ||
| 3794 | inserted = multibyte_chars_in_text (GPT_ADDR, inserted); | ||
| 3795 | adjust_after_replace (PT, PT_BYTE, PT, PT_BYTE, | ||
| 3796 | inserted, inserted_byte); | ||
| 3797 | } | ||
| 3779 | 3798 | ||
| 3780 | #ifdef DOS_NT | 3799 | #ifdef DOS_NT |
| 3781 | /* Use the conversion type to determine buffer-file-type | 3800 | /* Use the conversion type to determine buffer-file-type |
| @@ -3787,24 +3806,6 @@ This does code conversion according to the value of\n\ | |||
| 3787 | else | 3806 | else |
| 3788 | current_buffer->buffer_file_type = Qt; | 3807 | current_buffer->buffer_file_type = Qt; |
| 3789 | #endif | 3808 | #endif |
| 3790 | |||
| 3791 | record_insert (PT, inserted); | ||
| 3792 | |||
| 3793 | /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */ | ||
| 3794 | offset_intervals (current_buffer, PT, inserted); | ||
| 3795 | MODIFF++; | ||
| 3796 | |||
| 3797 | if (! NILP (coding.post_read_conversion)) | ||
| 3798 | { | ||
| 3799 | Lisp_Object val; | ||
| 3800 | |||
| 3801 | val = call1 (coding.post_read_conversion, make_number (inserted)); | ||
| 3802 | if (!NILP (val)) | ||
| 3803 | { | ||
| 3804 | CHECK_NUMBER (val, 0); | ||
| 3805 | inserted = XFASTINT (val); | ||
| 3806 | } | ||
| 3807 | } | ||
| 3808 | } | 3809 | } |
| 3809 | 3810 | ||
| 3810 | set_coding_system = 1; | 3811 | set_coding_system = 1; |