From: Eli Zaretskii Date: Sun, 13 Dec 2015 17:56:27 +0000 (+0200) Subject: Fix visiting files with raw-text X-Git-Tag: emacs-25.0.90~476 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=25e461c1c82656ae729b99a7b51b548d0c761304;p=emacs.git Fix visiting files with raw-text * src/fileio.c (Finsert_file_contents): Fix setting buffer unibyte when some stuff was actually read. (Bug#22162) --- diff --git a/src/fileio.c b/src/fileio.c index 8e44eb0d539..210383ff77a 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4265,7 +4265,10 @@ by calling `format-decode', which see. */) && NILP (replace)) /* Visiting a file with these coding system makes the buffer unibyte. */ - Fset_buffer_multibyte (Qnil); + 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));