aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmds.c
diff options
context:
space:
mode:
authorKenichi Handa2002-09-03 04:08:14 +0000
committerKenichi Handa2002-09-03 04:08:14 +0000
commit9ad8bfb0a0645b3bc9a7bf1298fa5f6808f4d8d5 (patch)
treebe0e87ae81a08d0c8d1feeaecf3c28045969690b /src/cmds.c
parent8d35924790e7166739309dc9a3986f43b9c5de63 (diff)
downloademacs-9ad8bfb0a0645b3bc9a7bf1298fa5f6808f4d8d5.tar.gz
emacs-9ad8bfb0a0645b3bc9a7bf1298fa5f6808f4d8d5.zip
(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.
Diffstat (limited to 'src/cmds.c')
-rw-r--r--src/cmds.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/cmds.c b/src/cmds.c
index 776e6b28083..21706d4ba80 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -360,7 +360,6 @@ internal_self_insert (c, noautofill)
360 /* At first, get multi-byte form of C in STR. */ 360 /* At first, get multi-byte form of C in STR. */
361 if (!NILP (current_buffer->enable_multibyte_characters)) 361 if (!NILP (current_buffer->enable_multibyte_characters))
362 { 362 {
363 c = unibyte_char_to_multibyte (c);
364 len = CHAR_STRING (c, str); 363 len = CHAR_STRING (c, str);
365 if (len == 1) 364 if (len == 1)
366 /* If C has modifier bits, this makes C an appropriate 365 /* If C has modifier bits, this makes C an appropriate
@@ -437,10 +436,19 @@ internal_self_insert (c, noautofill)
437 } 436 }
438 hairy = 2; 437 hairy = 2;
439 } 438 }
439
440 if (NILP (current_buffer->enable_multibyte_characters))
441 MAKE_CHAR_MULTIBYTE (c);
442 synt = SYNTAX (c);
443
440 if (!NILP (current_buffer->abbrev_mode) 444 if (!NILP (current_buffer->abbrev_mode)
441 && SYNTAX (c) != Sword 445 && synt != Sword
442 && NILP (current_buffer->read_only) 446 && NILP (current_buffer->read_only)
443 && PT > BEGV && SYNTAX (XFASTINT (Fprevious_char ())) == Sword) 447 && PT > BEGV
448 && (!NILP (current_buffer->enable_multibyte_characters)
449 ? SYNTAX (XFASTINT (Fprevious_char ())) == Sword
450 : (SYNTAX (unibyte_char_to_multibyte (XFASTINT (Fprevious_char ())))
451 == Sword)))
444 { 452 {
445 int modiff = MODIFF; 453 int modiff = MODIFF;
446 Lisp_Object sym; 454 Lisp_Object sym;
@@ -508,7 +516,6 @@ internal_self_insert (c, noautofill)
508 Vself_insert_face = Qnil; 516 Vself_insert_face = Qnil;
509 } 517 }
510 518
511 synt = SYNTAX (c);
512 if ((synt == Sclose || synt == Smath) 519 if ((synt == Sclose || synt == Smath)
513 && !NILP (Vblink_paren_function) && INTERACTIVE 520 && !NILP (Vblink_paren_function) && INTERACTIVE
514 && !noautofill) 521 && !noautofill)