aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Ingebrigtsen2014-02-08 22:32:30 -0800
committerLars Ingebrigtsen2014-02-08 22:32:30 -0800
commitc838bca91db36b3b8ad2405ecb8fff316313e71d (patch)
tree29ccc5665a8fe6bad70be47ef38162cc8e76f075 /src
parent438241f5189b1ea28f828c72d92555133e4088e7 (diff)
downloademacs-c838bca91db36b3b8ad2405ecb8fff316313e71d.tar.gz
emacs-c838bca91db36b3b8ad2405ecb8fff316313e71d.zip
* cmds.c (Fself_insert_command): Output a clearer error message on negative repetitions.
Fixes: debbugs:9476
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/cmds.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index db24d8c947f..399138a1d80 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12014-02-09 Lars Ingebrigtsen <larsi@gnus.org> 12014-02-09 Lars Ingebrigtsen <larsi@gnus.org>
2 2
3 * cmds.c (Fself_insert_command): Output a clearer error message on
4 negative repetitions (bug#9476).
5
3 * macros.c (Fexecute_kbd_macro): Doc fix (bug#14206). 6 * macros.c (Fexecute_kbd_macro): Doc fix (bug#14206).
4 7
52014-02-08 Lars Ingebrigtsen <larsi@gnus.org> 82014-02-08 Lars Ingebrigtsen <larsi@gnus.org>
diff --git a/src/cmds.c b/src/cmds.c
index 8d61c19fb3c..29c574abb14 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -268,6 +268,7 @@ static int nonundocount;
268DEFUN ("self-insert-command", Fself_insert_command, Sself_insert_command, 1, 1, "p", 268DEFUN ("self-insert-command", Fself_insert_command, Sself_insert_command, 1, 1, "p",
269 doc: /* Insert the character you type. 269 doc: /* Insert the character you type.
270Whichever character you type to run this command is inserted. 270Whichever character you type to run this command is inserted.
271The numeric prefix argument N says how many times to repeat the insertion.
271Before insertion, `expand-abbrev' is executed if the inserted character does 272Before insertion, `expand-abbrev' is executed if the inserted character does
272not have word syntax and the previous character in the buffer does. 273not have word syntax and the previous character in the buffer does.
273After insertion, the value of `auto-fill-function' is called if the 274After insertion, the value of `auto-fill-function' is called if the
@@ -276,7 +277,11 @@ At the end, it runs `post-self-insert-hook'. */)
276 (Lisp_Object n) 277 (Lisp_Object n)
277{ 278{
278 bool remove_boundary = 1; 279 bool remove_boundary = 1;
279 CHECK_NATNUM (n); 280 CHECK_NUMBER (n);
281
282 if (XFASTINT (n) < 1)
283 error ("Repetition argument is %d, but must be higher than 0.",
284 XFASTINT (n));
280 285
281 if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command))) 286 if (!EQ (Vthis_command, KVAR (current_kboard, Vlast_command)))
282 nonundocount = 0; 287 nonundocount = 0;