aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-01-09 23:04:20 +0000
committerRichard M. Stallman1998-01-09 23:04:20 +0000
commit216b9443d54960f08b006a2ec13241a62fad3146 (patch)
tree7306297ada63273bebe3d543451ffc1853b354f7 /src
parent87b089add48c722f825cd4cf1a1b3411647ae47e (diff)
downloademacs-216b9443d54960f08b006a2ec13241a62fad3146.tar.gz
emacs-216b9443d54960f08b006a2ec13241a62fad3146.zip
(internal_self_insert): Simplify handling of c2;
avoid testing enable-multibyte-characters. (internal_self_insert): Use make_multibyte_string.
Diffstat (limited to 'src')
-rw-r--r--src/cmds.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/cmds.c b/src/cmds.c
index 11e484921b6..cf7415741e8 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -372,11 +372,10 @@ internal_self_insert (c, noautofill)
372 we fill columns with spaces, if C is wider than C2, we delete 372 we fill columns with spaces, if C is wider than C2, we delete
373 C2 and several characters following C2. */ 373 C2 and several characters following C2. */
374 374
375 /* A code at `point'. Since this is checked only against 375 /* This is the character after point. */
376 NEWLINE and TAB, we don't need a character code but only the 376 int c2 = FETCH_CHAR (PT_BYTE);
377 first byte of multi-byte form. */ 377
378 unsigned char c2 = FETCH_BYTE (PT_BYTE); 378 /* Column the cursor should be placed at after this insertion.
379 /* A column the cursor should be placed at after this insertion.
380 The correct value should be calculated only when necessary. */ 379 The correct value should be calculated only when necessary. */
381 int target_clm = 0; 380 int target_clm = 0;
382 381
@@ -391,9 +390,8 @@ internal_self_insert (c, noautofill)
391 && ! (c2 == '\t' 390 && ! (c2 == '\t'
392 && XINT (current_buffer->tab_width) > 0 391 && XINT (current_buffer->tab_width) > 0
393 && XFASTINT (current_buffer->tab_width) < 20 392 && XFASTINT (current_buffer->tab_width) < 20
394 && ((NILP (current_buffer->enable_multibyte_characters) 393 && (target_clm = (current_column ()
395 ? (target_clm = current_column () + 1) 394 + XINT (Fchar_width (make_number (c2)))),
396 : (target_clm = current_column () + WIDTH_BY_CHAR_HEAD (str[0]))),
397 target_clm % XFASTINT (current_buffer->tab_width))))) 395 target_clm % XFASTINT (current_buffer->tab_width)))))
398 { 396 {
399 int pos = PT; 397 int pos = PT;
@@ -453,7 +451,7 @@ internal_self_insert (c, noautofill)
453 451
454 if (chars_to_delete) 452 if (chars_to_delete)
455 { 453 {
456 string = make_string (str, len); 454 string = make_multibyte_string (str, 1, len);
457 if (spaces_to_insert) 455 if (spaces_to_insert)
458 { 456 {
459 tem = Fmake_string (make_number (spaces_to_insert), 457 tem = Fmake_string (make_number (spaces_to_insert),