]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix visiting files with raw-text
authorEli Zaretskii <eliz@gnu.org>
Sun, 13 Dec 2015 17:56:27 +0000 (19:56 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 13 Dec 2015 17:56:27 +0000 (19:56 +0200)
* src/fileio.c (Finsert_file_contents): Fix setting buffer unibyte
when some stuff was actually read.  (Bug#22162)

src/fileio.c

index 8e44eb0d53967f283ccaad8fc42d3bb8107bc720..210383ff77a6585bb1b8869e737e2fc4b1c0fb03 100644 (file)
@@ -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));