summaryrefslogtreecommitdiff
path: root/src/intervals.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1993-09-14 12:10:53 +0000
committerRichard M. Stallman <rms@gnu.org>1993-09-14 12:10:53 +0000
commite0eb64572d1bf450b797c63abaf0e9bc9ebc0300 (patch)
tree672c2964bed980a0bb237b1cb759fa546ae01913 /src/intervals.c
parentbdc440b398e4047403b79775eaa777afb561d2af (diff)
downloademacs-e0eb64572d1bf450b797c63abaf0e9bc9ebc0300.tar.gz
(graft_intervals_into_buffer): New arg INHERIT.
Diffstat (limited to 'src/intervals.c')
-rw-r--r--src/intervals.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/intervals.c b/src/intervals.c
index 75525594929..a6be24f1860 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -1248,10 +1248,11 @@ make_new_interval (intervals, start, length)
text... */
void
-graft_intervals_into_buffer (source, position, buffer)
+graft_intervals_into_buffer (source, position, buffer, inherit)
INTERVAL source;
int position;
struct buffer *buffer;
+ int inherit;
{
register INTERVAL under, over, this, prev;
register INTERVAL tree = buffer->intervals;
@@ -1284,23 +1285,21 @@ graft_intervals_into_buffer (source, position, buffer)
tree = create_root_interval (buf);
}
}
- else
- if (TOTAL_LENGTH (tree) == TOTAL_LENGTH (source))
- /* If the buffer contains only the new string, but
- there was already some interval tree there, then it may be
- some zero length intervals. Eventually, do something clever
- about inserting properly. For now, just waste the old intervals. */
- {
- buffer->intervals = reproduce_tree (source, tree->parent);
- /* Explicitly free the old tree here. */
+ else if (TOTAL_LENGTH (tree) == TOTAL_LENGTH (source))
+ /* If the buffer contains only the new string, but
+ there was already some interval tree there, then it may be
+ some zero length intervals. Eventually, do something clever
+ about inserting properly. For now, just waste the old intervals. */
+ {
+ buffer->intervals = reproduce_tree (source, tree->parent);
+ /* Explicitly free the old tree here. */
- return;
- }
- else
- /* Paranoia -- the text has already been added, so this buffer
- should be of non-zero length. */
- if (TOTAL_LENGTH (tree) == 0)
- abort ();
+ return;
+ }
+ /* Paranoia -- the text has already been added, so this buffer
+ should be of non-zero length. */
+ else if (TOTAL_LENGTH (tree) == 0)
+ abort ();
this = under = find_interval (tree, position);
if (NULL_INTERVAL_P (under)) /* Paranoia */
@@ -1345,7 +1344,7 @@ graft_intervals_into_buffer (source, position, buffer)
else
this = under;
copy_properties (over, this);
- if (MERGE_INSERTIONS (this))
+ if (inherit)
merge_properties (over, this);
else
copy_properties (over, this);