Interactively, N is the prefix arg, and KILLFLAG is set if
N was explicitly specified.
-The command `delete-forward-char' is preferable for interactive use. */)
+The command `delete-forward-char' is preferable for interactive use, e.g.
+because it respects values of `delete-active-region' and `overwrite-mode'. */)
(Lisp_Object n, Lisp_Object killflag)
{
EMACS_INT pos;
bool remove_boundary = 1;
CHECK_NUMBER (n);
- if (XFASTINT (n) < 1)
- error ("Repetition argument is %d, but must be higher than 0.",
- XFASTINT (n));
+ if (XFASTINT (n) < 0)
+ error ("Negative repetition argument %"pI"d", XFASTINT (n));
if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command)))
nonundocount = 0;
int val = internal_self_insert (character, XFASTINT (n));
if (val == 2)
nonundocount = 0;
- frame_make_pointer_invisible ();
+ frame_make_pointer_invisible (SELECTED_FRAME ());
}
return Qnil;
}
else
{
- str[0] = (SINGLE_BYTE_CHAR_P (c)
- ? c
- : multibyte_char_to_unibyte (c));
+ str[0] = SINGLE_BYTE_CHAR_P (c) ? c : CHAR_TO_BYTE8 (c);
len = 1;
}
if (!NILP (overwrite)
and the hook has a non-nil `no-self-insert' property,
return right away--don't really self-insert. */
if (SYMBOLP (sym) && ! NILP (sym)
- && ! NILP (XSYMBOL (sym)->function)
- && SYMBOLP (XSYMBOL (sym)->function))
+ && ! NILP (SYMBOL_FUNCTION (sym))
+ && SYMBOLP (SYMBOL_FUNCTION (sym)))
{
Lisp_Object prop;
- prop = Fget (XSYMBOL (sym)->function, intern ("no-self-insert"));
+ prop = Fget (SYMBOL_FUNCTION (sym), intern ("no-self-insert"));
if (! NILP (prop))
return 1;
}
void
syms_of_cmds (void)
{
+#include "cmds.x"
+
DEFSYM (Qkill_backward_chars, "kill-backward-chars");
DEFSYM (Qkill_forward_chars, "kill-forward-chars");
DEFSYM (Qoverwrite_mode_binary, "overwrite-mode-binary");
doc: /* Hook run at the end of `self-insert-command'.
This is run after inserting the character. */);
Vpost_self_insert_hook = Qnil;
-
- defsubr (&Sforward_point);
- defsubr (&Sforward_char);
- defsubr (&Sbackward_char);
- defsubr (&Sforward_line);
- defsubr (&Sbeginning_of_line);
- defsubr (&Send_of_line);
-
- defsubr (&Sdelete_char);
- defsubr (&Sself_insert_command);
}
void