# HG changeset patch # User Richard M. Stallman # Date 873136465 0 # Node ID 063c22255157fcfa12b1160b0dd0bf8db623068b # Parent 940d50684d689fc0a7617aca6f7f2e8cc71cc74c (internal_self_insert): Only set TARGET_CLM when C2 is tab. When multibyte characters are disabled, use 1 as the width of the inserted character. diff -r 940d50684d68 -r 063c22255157 src/cmds.c --- a/src/cmds.c Mon Sep 01 17:14:48 1997 +0000 +++ b/src/cmds.c Mon Sep 01 17:54:25 1997 +0000 @@ -396,20 +396,21 @@ The correct value should be calculated only when necessary. */ int target_clm = 0; - /* Overwriting in binary-mode always substitute C2 by C. But, - overwriting in textual-mode does this substitution in the - case that C is not NEWLINE and C2 is not NEWLINE nor TAB. If - C2 is TAB, the substitution is done only when C2 is currently - expanded to 0 column, or more than 20 columns, or more than - the width of C. */ + /* Overwriting in binary-mode always replaces C2 by C. + Overwriting in textual-mode doesn't always do that. + It inserts newlines in the usual way, + and inserts any character at end of line + or before a tab if it doesn't use the whole width of the tab. */ if (EQ (overwrite, Qoverwrite_mode_binary) || (c != '\n' && c2 != '\n' - && (target_clm = current_column() + WIDTH_BY_CHAR_HEAD (str[0]), - (c2 != '\t' - || XINT (current_buffer->tab_width) <= 0 - || XFASTINT (current_buffer->tab_width) > 20 - || !(target_clm % XFASTINT (current_buffer->tab_width)))))) + && ! (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 % XFASTINT (current_buffer->tab_width))))) { int pos = PT;