aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-01-21 21:56:46 +0000
committerRichard M. Stallman1998-01-21 21:56:46 +0000
commit49bc32b0a5de2d4af7746fdf6670d724f9d943d1 (patch)
treedf3d112d453c4758a4d73ab3ccce25f29e6f844c /src
parent14a65ffe4289dc2a067b9635cc3a56606383e23a (diff)
downloademacs-49bc32b0a5de2d4af7746fdf6670d724f9d943d1.tar.gz
emacs-49bc32b0a5de2d4af7746fdf6670d724f9d943d1.zip
(internal_self_insert, Fself_insert_command):
Use unibyte_char_to_multibyte. (nonascii_insert_offset): Variable moved to charset.c. (syms_of_cmds): Don't initialize nonascii_insert_offset.
Diffstat (limited to 'src')
-rw-r--r--src/cmds.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/cmds.c b/src/cmds.c
index cf7415741e8..45a03bc0875 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -39,9 +39,6 @@ Lisp_Object Vself_insert_face;
39/* This is the command that set up Vself_insert_face. */ 39/* This is the command that set up Vself_insert_face. */
40Lisp_Object Vself_insert_face_command; 40Lisp_Object Vself_insert_face_command;
41 41
42/* Offset to add to a non-ASCII value when inserting it. */
43int nonascii_insert_offset;
44
45extern Lisp_Object Qface; 42extern Lisp_Object Qface;
46 43
47DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0, 44DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0,
@@ -297,9 +294,8 @@ Whichever character you type to run this command is inserted.")
297 /* Add the offset to the character, for Finsert_char. 294 /* Add the offset to the character, for Finsert_char.
298 We pass internal_self_insert the unmodified character 295 We pass internal_self_insert the unmodified character
299 because it itself does this offsetting. */ 296 because it itself does this offsetting. */
300 if (modified_char >= 0200 && modified_char <= 0377 297 if (! NILP (current_buffer->enable_multibyte_characters))
301 && ! NILP (current_buffer->enable_multibyte_characters)) 298 modified_char = unibyte_char_to_multibyte (modified_char);
302 modified_char += nonascii_insert_offset;
303 299
304 XSETFASTINT (n, XFASTINT (n) - 2); 300 XSETFASTINT (n, XFASTINT (n) - 2);
305 /* The first one might want to expand an abbrev. */ 301 /* The first one might want to expand an abbrev. */
@@ -345,9 +341,8 @@ internal_self_insert (c, noautofill)
345 int chars_to_delete = 0; 341 int chars_to_delete = 0;
346 int spaces_to_insert = 0; 342 int spaces_to_insert = 0;
347 343
348 if (c >= 0200 && c <= 0377 344 if (! NILP (current_buffer->enable_multibyte_characters))
349 && ! NILP (current_buffer->enable_multibyte_characters)) 345 c = unibyte_char_to_multibyte (c);
350 c += nonascii_insert_offset;
351 346
352 overwrite = current_buffer->overwrite_mode; 347 overwrite = current_buffer->overwrite_mode;
353 if (!NILP (Vbefore_change_function) || !NILP (Vafter_change_function) 348 if (!NILP (Vbefore_change_function) || !NILP (Vafter_change_function)
@@ -534,13 +529,6 @@ If `last-command' does not equal this value, we ignore `self-insert-face'.");
534More precisely, a char with closeparen syntax is self-inserted."); 529More precisely, a char with closeparen syntax is self-inserted.");
535 Vblink_paren_function = Qnil; 530 Vblink_paren_function = Qnil;
536 531
537 DEFVAR_INT ("nonascii-insert-offset", &nonascii_insert_offset,
538 "Offset to add to a non-ascii code 0200...0377 when inserting it.\n\
539This applies only when multibyte characters are enabled, and it serves\n\
540to convert a Latin-1 or similar 8-bit character code to the corresponding\n\
541Emacs character code.");
542 nonascii_insert_offset = 0;
543
544 defsubr (&Sforward_point); 532 defsubr (&Sforward_point);
545 defsubr (&Sforward_char); 533 defsubr (&Sforward_char);
546 defsubr (&Sbackward_char); 534 defsubr (&Sbackward_char);