From e12496667830fbd310b082d1a9c1b60cb6bd7b53 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Fri, 24 Aug 2001 08:35:09 +0000 Subject: [PATCH] (Finsert_file_contents): Set coding's dest_multibyte to 0 also in the REPLACE case. --- src/ChangeLog | 5 +++++ src/fileio.c | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 18e0ce0b93b..0cc3e9d036e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-08-24 Gerd Moellmann + + * fileio.c (Finsert_file_contents): Set coding's dest_multibyte + to 0 also in the REPLACE case. + 2001-08-24 Andrew Choi * fileio.c (Ffile_readable_p) [macintosh]: Call access instead of diff --git a/src/fileio.c b/src/fileio.c index 0b33668ab5d..c9fe5834060 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4343,16 +4343,18 @@ actually used.") && (coding.type == coding_type_no_conversion || coding.type == coding_type_raw_text)) { - /* Visiting a file with these coding system always make the buffer - unibyte. */ + /* Visiting a file with these coding systems should always make + the buffer unibyte. If we happen to be replacing text in a + multibyte buffer (this happens when reverting an RMAIL + buffer), positions in the buffer, markers etc. may have byte + positions != character positions, so just setting + enable_multibyte_characters to nil doesn't suffice. */ if (!NILP (replace) && !NILP (current_buffer->enable_multibyte_characters)) Fset_buffer_multibyte (Qnil); else - { - current_buffer->enable_multibyte_characters = Qnil; - coding.dst_multibyte = 0; - } + current_buffer->enable_multibyte_characters = Qnil; + coding.dst_multibyte = 0; } if (inserted > 0 || coding.type == coding_type_ccl) -- 2.39.5