From 25e461c1c82656ae729b99a7b51b548d0c761304 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 13 Dec 2015 19:56:27 +0200 Subject: [PATCH] Fix visiting files with raw-text * src/fileio.c (Finsert_file_contents): Fix setting buffer unibyte when some stuff was actually read. (Bug#22162) --- src/fileio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)); -- 2.39.2