aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1997-09-01 17:54:25 +0000
committerRichard M. Stallman1997-09-01 17:54:25 +0000
commit37c0ed09e7005ee18546f62d9468f1093297a4f9 (patch)
treef9eaee95ec0301575857aa5f83b2a1753d6e8eb8 /src
parent1b76aedd978cee291828eaf96ce20606bacbe6d8 (diff)
downloademacs-37c0ed09e7005ee18546f62d9468f1093297a4f9.tar.gz
emacs-37c0ed09e7005ee18546f62d9468f1093297a4f9.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/cmds.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/cmds.c b/src/cmds.c
index fac3791794f..70dfbceb7f0 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -396,20 +396,21 @@ internal_self_insert (c, noautofill)
396 The correct value should be calculated only when necessary. */ 396 The correct value should be calculated only when necessary. */
397 int target_clm = 0; 397 int target_clm = 0;
398 398
399 /* Overwriting in binary-mode always substitute C2 by C. But, 399 /* Overwriting in binary-mode always replaces C2 by C.
400 overwriting in textual-mode does this substitution in the 400 Overwriting in textual-mode doesn't always do that.
401 case that C is not NEWLINE and C2 is not NEWLINE nor TAB. If 401 It inserts newlines in the usual way,
402 C2 is TAB, the substitution is done only when C2 is currently 402 and inserts any character at end of line
403 expanded to 0 column, or more than 20 columns, or more than 403 or before a tab if it doesn't use the whole width of the tab. */
404 the width of C. */
405 if (EQ (overwrite, Qoverwrite_mode_binary) 404 if (EQ (overwrite, Qoverwrite_mode_binary)
406 || (c != '\n' 405 || (c != '\n'
407 && c2 != '\n' 406 && c2 != '\n'
408 && (target_clm = current_column() + WIDTH_BY_CHAR_HEAD (str[0]), 407 && ! (c2 == '\t'
409 (c2 != '\t' 408 && XINT (current_buffer->tab_width) > 0
410 || XINT (current_buffer->tab_width) <= 0 409 && XFASTINT (current_buffer->tab_width) < 20
411 || XFASTINT (current_buffer->tab_width) > 20 410 && ((NILP (current_buffer->enable_multibyte_characters)
412 || !(target_clm % XFASTINT (current_buffer->tab_width)))))) 411 ? (target_clm = current_column () + 1)
412 : (target_clm = current_column () + WIDTH_BY_CHAR_HEAD (str[0]))),
413 target_clm % XFASTINT (current_buffer->tab_width)))))
413 { 414 {
414 int pos = PT; 415 int pos = PT;
415 416