From: Richard M. Stallman Date: Tue, 30 Sep 2003 12:33:19 +0000 (+0000) Subject: (graft_intervals_into_buffer): Handle over_used when splitting UNDER. X-Git-Tag: ttn-vms-21-2-B4~8691 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=34894ec3c701c36b964b3afd804688909136881e;p=emacs.git (graft_intervals_into_buffer): Handle over_used when splitting UNDER. Set BUF_INTERVALS (buffer)->up_obj when appropriate. --- diff --git a/src/intervals.c b/src/intervals.c index a15011f481d..d3f814d60ce 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1746,6 +1746,7 @@ graft_intervals_into_buffer (source, position, length, buffer, inherit) XSETBUFFER (buf, buffer); BUF_INTERVALS (buffer) = reproduce_tree_obj (source, buf); BUF_INTERVALS (buffer)->position = BEG; + BUF_INTERVALS (buffer)->up_obj = 1; /* Explicitly free the old tree here? */ @@ -1768,6 +1769,7 @@ graft_intervals_into_buffer (source, position, length, buffer, inherit) { BUF_INTERVALS (buffer) = reproduce_tree (source, INTERVAL_PARENT (tree)); BUF_INTERVALS (buffer)->position = BEG; + BUF_INTERVALS (buffer)->up_obj = 1; /* Explicitly free the old tree here. */ return; @@ -1823,9 +1825,9 @@ graft_intervals_into_buffer (source, position, length, buffer, inherit) while (! NULL_INTERVAL_P (over)) { /* If UNDER is longer than OVER, split it. */ - if (LENGTH (over) < LENGTH (under)) + if (LENGTH (over) - over_used < LENGTH (under)) { - this = split_interval_left (under, LENGTH (over)); + this = split_interval_left (under, LENGTH (over) - over_used); copy_properties (under, this); } else