]> git.eshelyaron.com Git - emacs.git/commitdiff
* cmds.c (Fself_insert_command): Output a clearer error message on negative repetitions.
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 9 Feb 2014 06:32:30 +0000 (22:32 -0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 9 Feb 2014 06:32:30 +0000 (22:32 -0800)
Fixes: debbugs:9476
src/ChangeLog
src/cmds.c

index db24d8c947f2605d82994e451973b0ad477a4c6f..399138a1d806480c9b93f3f85c3d155f231a911e 100644 (file)
@@ -1,5 +1,8 @@
 2014-02-09  Lars Ingebrigtsen  <larsi@gnus.org>
 
+       * cmds.c (Fself_insert_command): Output a clearer error message on
+       negative repetitions (bug#9476).
+
        * macros.c (Fexecute_kbd_macro): Doc fix (bug#14206).
 
 2014-02-08  Lars Ingebrigtsen  <larsi@gnus.org>
index 8d61c19fb3c51fa07b1b90c17f33219662c76f41..29c574abb14d982a53b0fa2752002bda96506279 100644 (file)
@@ -268,6 +268,7 @@ static int nonundocount;
 DEFUN ("self-insert-command", Fself_insert_command, Sself_insert_command, 1, 1, "p",
        doc: /* Insert the character you type.
 Whichever character you type to run this command is inserted.
+The numeric prefix argument N says how many times to repeat the insertion.
 Before insertion, `expand-abbrev' is executed if the inserted character does
 not have word syntax and the previous character in the buffer does.
 After insertion, the value of `auto-fill-function' is called if the
@@ -276,7 +277,11 @@ At the end, it runs `post-self-insert-hook'.  */)
   (Lisp_Object n)
 {
   bool remove_boundary = 1;
-  CHECK_NATNUM (n);
+  CHECK_NUMBER (n);
+
+  if (XFASTINT (n) < 1)
+    error ("Repetition argument is %d, but must be higher than 0.",
+          XFASTINT (n));
 
   if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command)))
     nonundocount = 0;