changeset 89057:08f4bdc64a89

(internal_self_insert): In a multibyte buffer, insert C as is without converting it to unibyte. In a unibyte buffer, convert C to multibyte before checking the syntax.
author Kenichi Handa <handa@m17n.org>
date Tue, 03 Sep 2002 04:08:14 +0000
parents 496be2b262c6
children c58aec54e4fb
files src/cmds.c
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/cmds.c	Tue Sep 03 04:07:54 2002 +0000
+++ b/src/cmds.c	Tue Sep 03 04:08:14 2002 +0000
@@ -360,7 +360,6 @@
   /* At first, get multi-byte form of C in STR.  */
   if (!NILP (current_buffer->enable_multibyte_characters))
     {
-      c = unibyte_char_to_multibyte (c);
       len = CHAR_STRING (c, str);
       if (len == 1)
 	/* If C has modifier bits, this makes C an appropriate
@@ -437,10 +436,19 @@
 	}
       hairy = 2;
     }
+
+  if (NILP (current_buffer->enable_multibyte_characters))
+    MAKE_CHAR_MULTIBYTE (c);
+  synt = SYNTAX (c);
+
   if (!NILP (current_buffer->abbrev_mode)
-      && SYNTAX (c) != Sword
+      && synt != Sword
       && NILP (current_buffer->read_only)
-      && PT > BEGV && SYNTAX (XFASTINT (Fprevious_char ())) == Sword)
+      && PT > BEGV
+      && (!NILP (current_buffer->enable_multibyte_characters)
+	  ? SYNTAX (XFASTINT (Fprevious_char ())) == Sword
+	  : (SYNTAX (unibyte_char_to_multibyte (XFASTINT (Fprevious_char ())))
+	     == Sword)))
     {
       int modiff = MODIFF;
       Lisp_Object sym;
@@ -508,7 +516,6 @@
       Vself_insert_face = Qnil;
     }
 
-  synt = SYNTAX (c);
   if ((synt == Sclose || synt == Smath)
       && !NILP (Vblink_paren_function) && INTERACTIVE
       && !noautofill)