From e2eeabbbce46812614429c7a20bfb3d43acd1ef9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 28 Aug 1994 06:07:15 +0000 Subject: [PATCH] (Finsert_char): New arg INHERIT. Use insert_and_inherit if requested. --- src/editfns.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/editfns.c b/src/editfns.c index 13cee5c5d25..6002caab9d4 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -856,12 +856,14 @@ Any other markers at the point of insertion also end up after the text.") return Qnil; } -DEFUN ("insert-char", Finsert_char, Sinsert_char, 2, 2, 0, +DEFUN ("insert-char", Finsert_char, Sinsert_char, 2, 3, 0, "Insert COUNT (second arg) copies of CHAR (first arg).\n\ Point and all markers are affected as in the function `insert'.\n\ -Both arguments are required.") - (chr, count) - Lisp_Object chr, count; +Both arguments are required.\n\ +The optional third arg INHERIT, if non-nil, says to inherit text properties\n\ +from adjoining text, if those properties are sticky.") + (chr, count, inherit) + Lisp_Object chr, count, inherit; { register unsigned char *string; register int strlen; @@ -879,7 +881,10 @@ Both arguments are required.") string[i] = XFASTINT (chr); while (n >= strlen) { - insert (string, strlen); + if (!NILP (inherit)) + insert_and_inherit (string, strlen); + else + insert (string, strlen); n -= strlen; } if (n > 0)