summaryrefslogtreecommitdiff
path: root/src/cmds.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-01-09 23:04:20 +0000
committerRichard M. Stallman <rms@gnu.org>1998-01-09 23:04:20 +0000
commit216b9443d54960f08b006a2ec13241a62fad3146 (patch)
tree7306297ada63273bebe3d543451ffc1853b354f7 /src/cmds.c
parent87b089add48c722f825cd4cf1a1b3411647ae47e (diff)
downloademacs-216b9443d54960f08b006a2ec13241a62fad3146.tar.gz
(internal_self_insert): Simplify handling of c2;
avoid testing enable-multibyte-characters. (internal_self_insert): Use make_multibyte_string.
Diffstat (limited to 'src/cmds.c')
-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)
we fill columns with spaces, if C is wider than C2, we delete
C2 and several characters following C2. */
- /* A code at `point'. Since this is checked only against
- NEWLINE and TAB, we don't need a character code but only the
- first byte of multi-byte form. */
- unsigned char c2 = FETCH_BYTE (PT_BYTE);
- /* A column the cursor should be placed at after this insertion.
+ /* This is the character after point. */
+ int c2 = FETCH_CHAR (PT_BYTE);
+
+ /* Column the cursor should be placed at after this insertion.
The correct value should be calculated only when necessary. */
int target_clm = 0;
@@ -391,9 +390,8 @@ internal_self_insert (c, noautofill)
&& ! (c2 == '\t'
&& XINT (current_buffer->tab_width) > 0
&& XFASTINT (current_buffer->tab_width) < 20
- && ((NILP (current_buffer->enable_multibyte_characters)
- ? (target_clm = current_column () + 1)
- : (target_clm = current_column () + WIDTH_BY_CHAR_HEAD (str[0]))),
+ && (target_clm = (current_column ()
+ + XINT (Fchar_width (make_number (c2)))),
target_clm % XFASTINT (current_buffer->tab_width)))))
{
int pos = PT;
@@ -453,7 +451,7 @@ internal_self_insert (c, noautofill)
if (chars_to_delete)
{
- string = make_string (str, len);
+ string = make_multibyte_string (str, 1, len);
if (spaces_to_insert)
{
tem = Fmake_string (make_number (spaces_to_insert),