aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2001-11-11 20:02:58 +0000
committerRichard M. Stallman2001-11-11 20:02:58 +0000
commit34e096ed98d17af8e2838d8aa97e805302516927 (patch)
tree538223a872cc42a3e10dc16a290a9b21cba1cd19 /src
parentc77c48d99297ad605f791495f967e9718bb797a1 (diff)
downloademacs-34e096ed98d17af8e2838d8aa97e805302516927.tar.gz
emacs-34e096ed98d17af8e2838d8aa97e805302516927.zip
(graft_intervals_into_buffer):
Use set_text_properties_1 to clear out properties.
Diffstat (limited to 'src')
-rw-r--r--src/intervals.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/intervals.c b/src/intervals.c
index e37b671fd82..b55cd64e45e 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1683,20 +1683,19 @@ graft_intervals_into_buffer (source, position, length, buffer, inherit)
1683 1683
1684 tree = BUF_INTERVALS (buffer); 1684 tree = BUF_INTERVALS (buffer);
1685 1685
1686 /* If the new text has no properties, it becomes part of whatever 1686 /* If the new text has no properties, then with inheritance it
1687 interval it was inserted into. */ 1687 becomes part of whatever interval it was inserted into.
1688 To prevent inheritance, we must clear out the properties
1689 of the newly inserted text. */
1688 if (NULL_INTERVAL_P (source)) 1690 if (NULL_INTERVAL_P (source))
1689 { 1691 {
1690 Lisp_Object buf; 1692 Lisp_Object buf;
1691 if (!inherit && ! NULL_INTERVAL_P (tree)) 1693 if (!inherit && ! NULL_INTERVAL_P (tree))
1692 { 1694 {
1693 int saved_inhibit_modification_hooks = inhibit_modification_hooks;
1694 XSETBUFFER (buf, buffer); 1695 XSETBUFFER (buf, buffer);
1695 inhibit_modification_hooks = 1; 1696 set_text_properties_1 (make_number (position),
1696 Fset_text_properties (make_number (position), 1697 make_number (position + length),
1697 make_number (position + length), 1698 Qnil, buf, 0);
1698 Qnil, buf);
1699 inhibit_modification_hooks = saved_inhibit_modification_hooks;
1700 } 1699 }
1701 if (! NULL_INTERVAL_P (BUF_INTERVALS (buffer))) 1700 if (! NULL_INTERVAL_P (BUF_INTERVALS (buffer)))
1702 BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer)); 1701 BUF_INTERVALS (buffer) = balance_an_interval (BUF_INTERVALS (buffer));