diff options
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/fileio.c b/src/fileio.c index 6cda1e39eed..e18ddb1a7aa 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4263,9 +4263,14 @@ by calling `format-decode', which see. */) if (CODING_FOR_UNIBYTE (&coding) /* Can't do this if part of the buffer might be preserved. */ && NILP (replace)) - /* Visiting a file with these coding system makes the buffer - unibyte. */ - bset_enable_multibyte_characters (current_buffer, Qnil); + { + /* Visiting a file with these coding system makes the buffer + unibyte. */ + if (inserted > 0) + bset_enable_multibyte_characters (current_buffer, Qnil); + else + Fset_buffer_multibyte (Qnil); + } } coding.dst_multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); |