diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 15 |
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 | ||
| 859 | DEFUN ("insert-char", Finsert_char, Sinsert_char, 2, 2, 0, | 859 | DEFUN ("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\ |
| 861 | Point and all markers are affected as in the function `insert'.\n\ | 861 | Point and all markers are affected as in the function `insert'.\n\ |
| 862 | Both arguments are required.") | 862 | Both arguments are required.\n\ |
| 863 | (chr, count) | 863 | The optional third arg INHERIT, if non-nil, says to inherit text properties\n\ |
| 864 | Lisp_Object chr, count; | 864 | from 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) |