]> git.eshelyaron.com Git - emacs.git/commitdiff
(read1): When reading from a file, default string to
authorRichard M. Stallman <rms@gnu.org>
Sun, 3 Mar 2002 20:06:11 +0000 (20:06 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 3 Mar 2002 20:06:11 +0000 (20:06 +0000)
multibyte only if it has some multibyte characters.

src/lread.c

index 10baf509918ab628568ea6701225c5d9d421930c..5fa76b08280d9fc5b664e6a62b2fb2962cc98901 100644 (file)
@@ -2260,9 +2260,11 @@ read1 (readcharfun, pch, first_in_list)
               compiled Emacs Lisp files, and those always use the
               Emacs internal encoding.  Meanwhile, Qlambda is used
               for reading dynamic byte code (compiled with
-              byte-compile-dynamic = t).  */
+              byte-compile-dynamic = t).  So make the string multibyte
+              if the string contains any multibyte sequences.
+              (to_multibyte is a no-op if not.)  */
            to_multibyte (&p, &end, &nchars);
-           is_multibyte = 1;
+           is_multibyte = (p - read_buffer) != nchars;
          }
        else
          /* In all other cases, if we read these bytes as