]> code.delx.au - gnu-emacs/blobdiff - src/cmds.c
Merge from emacs-24; up to 2014-06-19T14:03:45Z!monnier@iro.umontreal.ca
[gnu-emacs] / src / cmds.c
index 29c574abb14d982a53b0fa2752002bda96506279..20234638778ab22a6f722fc7efca2a27fcd193a7 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)