Mercurial > emacs
changeset 38932:8328e5ca5f55
(Finsert_file_contents): Set coding's dest_multibyte
to 0 also in the REPLACE case.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 24 Aug 2001 08:34:50 +0000 |
parents | dc047d3af2cd |
children | 9d151c5325f1 |
files | src/fileio.c |
diffstat | 1 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fileio.c Fri Aug 24 07:46:40 2001 +0000 +++ b/src/fileio.c Fri Aug 24 08:34:50 2001 +0000 @@ -4343,16 +4343,18 @@ && (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)