declare smobs in alloc.c
[bpt/emacs.git] / src / cmds.c
index 29c574a..3755ac3 100644 (file)
@@ -229,7 +229,8 @@ Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).
 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;
@@ -279,9 +280,8 @@ At the end, it runs `post-self-insert-hook'.  */)
   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;
@@ -315,7 +315,7 @@ At the end, it runs `post-self-insert-hook'.  */)
     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;
@@ -359,9 +359,7 @@ internal_self_insert (int c, EMACS_INT n)
     }
   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)
@@ -450,11 +448,11 @@ internal_self_insert (int c, EMACS_INT n)
         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;
        }
@@ -524,6 +522,8 @@ internal_self_insert (int c, EMACS_INT n)
 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");
@@ -534,16 +534,6 @@ syms_of_cmds (void)
               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