changeset 5701:ad35a0cd95f5

Allow self-insert-command to be called noninteractively with null argument.
author Stephen J. Turnbull <stephen@xemacs.org>
date Mon, 24 Dec 2012 15:12:52 +0900
parents 37479d841681
children c65b0329894b
files src/ChangeLog src/cmds.c
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Dec 24 14:12:51 2012 +0900
+++ b/src/ChangeLog	Mon Dec 24 15:12:52 2012 +0900
@@ -1,3 +1,8 @@
+2012-12-24  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* cmds.c (Fself_insert_command):
+	Allow noninteractive call with null argument.
+
 2012-12-24  Stephen J. Turnbull  <stephen@xemacs.org>
 
 	Based on patch by Benson and Steven Mitchell on XEmacs Beta
--- a/src/cmds.c	Mon Dec 24 14:12:51 2012 +0900
+++ b/src/cmds.c	Mon Dec 24 15:12:52 2012 +0900
@@ -332,6 +332,9 @@
   Lisp_Object c;
   EMACS_INT n;
 
+  /* It is sometimes useful to specify `self-insert-commmand' in Lisp code.
+     We may as well as all that to be done with default = 1. */
+  count = NILP (count) ? make_int(1) : count;
   /* Can't insert more than most-positive-fixnum characters, the buffer
      won't hold that many. */
   check_integer_range (count, Qzero, make_fixnum (MOST_POSITIVE_FIXNUM));