(Fbyte_code): Convert a unibyte character to multibyte if necessary.
authorKenichi Handa <handa@m17n.org>
Tue, 3 Sep 2002 04:06:33 +0000 (04:06 +0000)
committerKenichi Handa <handa@m17n.org>
Tue, 3 Sep 2002 04:06:33 +0000 (04:06 +0000)
src/bytecode.c

index 6c4e34d..df6eb26 100644 (file)
@@ -1433,10 +1433,17 @@ If the third argument is incorrect, Emacs may crash.  */)
          break;
 
        case Bchar_syntax:
-         BEFORE_POTENTIAL_GC ();
-         CHECK_NUMBER (TOP);
-         AFTER_POTENTIAL_GC ();
-         XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (XINT (TOP))]);
+         {
+           int c;
+
+           BEFORE_POTENTIAL_GC ();
+           CHECK_CHARACTER (TOP);
+           AFTER_POTENTIAL_GC ();
+           c = XFASTINT (TOP);
+           if (NILP (current_buffer->enable_multibyte_characters))
+             MAKE_CHAR_MULTIBYTE (c);
+           XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (c)]);
+         }         
          break;
 
        case Bbuffer_substring: