summaryrefslogtreecommitdiff
path: root/src/insdel.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-08-28 06:07:37 +0000
committerRichard M. Stallman <rms@gnu.org>1994-08-28 06:07:37 +0000
commitc6f1eb998ec17be33866bee743289f1ec131a097 (patch)
treed23baa2d5548cffcb0af9b35abeae17037f1a3ea /src/insdel.c
parent0a546fbdac29f816180006a0a3c580a5d45bfe66 (diff)
downloademacs-c6f1eb998ec17be33866bee743289f1ec131a097.tar.gz
(insert_1): New arg INHERIT.
(insert_and_inherit): New function.
Diffstat (limited to 'src/insdel.c')
-rw-r--r--src/insdel.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 5ddf391b863..d368cd86ac1 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -309,15 +309,27 @@ insert (string, length)
{
if (length > 0)
{
- insert_1 (string, length);
+ insert_1 (string, length, 0);
+ signal_after_change (PT-length, 0, length);
+ }
+}
+
+insert_and_inherit (string, length)
+ register unsigned char *string;
+ register length;
+{
+ if (length > 0)
+ {
+ insert_1 (string, length, 1);
signal_after_change (PT-length, 0, length);
}
}
static void
-insert_1 (string, length)
+insert_1 (string, length, inherit)
register unsigned char *string;
register length;
+ int inherit;
{
register Lisp_Object temp;
@@ -346,6 +358,10 @@ insert_1 (string, length)
ZV += length;
Z += length;
adjust_point (length);
+
+ if (!inherit)
+ Fset_text_properties (make_number (PT - length), make_number (PT),
+ Qnil, Qnil);
}
/* Insert the part of the text of STRING, a Lisp object assumed to be
@@ -442,7 +458,7 @@ insert_before_markers (string, length)
if (length > 0)
{
register int opoint = PT;
- insert_1 (string, length);
+ insert_1 (string, length, 1);
adjust_markers (opoint - 1, opoint, length);
signal_after_change (PT-length, 0, length);
}