diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2014-02-08 22:32:30 -0800 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2014-02-08 22:32:30 -0800 |
commit | c838bca91db36b3b8ad2405ecb8fff316313e71d (patch) | |
tree | 29ccc5665a8fe6bad70be47ef38162cc8e76f075 /src/cmds.c | |
parent | 438241f5189b1ea28f828c72d92555133e4088e7 (diff) | |
download | emacs-c838bca91db36b3b8ad2405ecb8fff316313e71d.tar.gz |
* cmds.c (Fself_insert_command): Output a clearer error message on negative repetitions.
Fixes: debbugs:9476
Diffstat (limited to 'src/cmds.c')
-rw-r--r-- | src/cmds.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; 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; |