summaryrefslogtreecommitdiff
path: root/src/intervals.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-11-25 06:28:03 +0000
committerRichard M. Stallman <rms@gnu.org>1993-11-25 06:28:03 +0000
commitf222d99fe02b6e9212e0e6cd6e24877b00c69a25 (patch)
tree85c847ac58b3ce7ab7561f3c5bcd1e0fad2025de /src/intervals.c
parentf04381f0c2e09c12b4903e8d2a8728e82802ae86 (diff)
downloademacs-f222d99fe02b6e9212e0e6cd6e24877b00c69a25.tar.gz
(graft_intervals_into_buffer): New arg LENGTH.
If source has no intervals, set dest properties to nil.
Diffstat (limited to 'src/intervals.c')
-rw-r--r--src/intervals.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/intervals.c b/src/intervals.c
index 59a0cd9a102..3c67f215aa6 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1221,6 +1221,7 @@ make_new_interval (intervals, start, length)
#endif
/* Insert the intervals of SOURCE into BUFFER at POSITION.
+ LENGTH is the length of the text in SOURCE.
This is used in insdel.c when inserting Lisp_Strings into the
buffer. The text corresponding to SOURCE is already in the buffer
@@ -1228,7 +1229,8 @@ make_new_interval (intervals, start, length)
belonging to the string being inserted; intervals are never
shared.
- If the inserted text had no intervals associated, this function
+ If the inserted text had no intervals associated, and we don't
+ want to inherit the surrounding text's properties, this function
simply returns -- offset_intervals should handle placing the
text in the correct interval, depending on the sticky bits.
@@ -1253,9 +1255,9 @@ make_new_interval (intervals, start, length)
text... */
void
-graft_intervals_into_buffer (source, position, buffer, inherit)
+graft_intervals_into_buffer (source, position, length, buffer, inherit)
INTERVAL source;
- int position;
+ int position, length;
struct buffer *buffer;
int inherit;
{
@@ -1266,7 +1268,17 @@ graft_intervals_into_buffer (source, position, buffer, inherit)
/* If the new text has no properties, it becomes part of whatever
interval it was inserted into. */
if (NULL_INTERVAL_P (source))
- return;
+ {
+ Lisp_Object buf;
+ if (!inherit)
+ {
+ XSET (buf, Lisp_Buffer, buffer);
+ Fset_text_properties (make_number (position),
+ make_number (position + length),
+ Qnil, buf);
+ }
+ return;
+ }
if (NULL_INTERVAL_P (tree))
{