aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-08-28 06:07:15 +0000
committerRichard M. Stallman1994-08-28 06:07:15 +0000
commite2eeabbbce46812614429c7a20bfb3d43acd1ef9 (patch)
treef45be509ee14fae358769e40263d1f0970b03e1a /src
parent2e252751cb29cc8adef5b98d47662c0f8039f980 (diff)
downloademacs-e2eeabbbce46812614429c7a20bfb3d43acd1ef9.tar.gz
emacs-e2eeabbbce46812614429c7a20bfb3d43acd1ef9.zip
(Finsert_char): New arg INHERIT.
Use insert_and_inherit if requested.
Diffstat (limited to 'src')
-rw-r--r--src/editfns.c15
1 files 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.")
856 return Qnil; 856 return Qnil;
857} 857}
858 858
859DEFUN ("insert-char", Finsert_char, Sinsert_char, 2, 2, 0, 859DEFUN ("insert-char", Finsert_char, Sinsert_char, 2, 3, 0,
860 "Insert COUNT (second arg) copies of CHAR (first arg).\n\ 860 "Insert COUNT (second arg) copies of CHAR (first arg).\n\
861Point and all markers are affected as in the function `insert'.\n\ 861Point and all markers are affected as in the function `insert'.\n\
862Both arguments are required.") 862Both arguments are required.\n\
863 (chr, count) 863The optional third arg INHERIT, if non-nil, says to inherit text properties\n\
864 Lisp_Object chr, count; 864from adjoining text, if those properties are sticky.")
865 (chr, count, inherit)
866 Lisp_Object chr, count, inherit;
865{ 867{
866 register unsigned char *string; 868 register unsigned char *string;
867 register int strlen; 869 register int strlen;
@@ -879,7 +881,10 @@ Both arguments are required.")
879 string[i] = XFASTINT (chr); 881 string[i] = XFASTINT (chr);
880 while (n >= strlen) 882 while (n >= strlen)
881 { 883 {
882 insert (string, strlen); 884 if (!NILP (inherit))
885 insert_and_inherit (string, strlen);
886 else
887 insert (string, strlen);
883 n -= strlen; 888 n -= strlen;
884 } 889 }
885 if (n > 0) 890 if (n > 0)