aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2003-09-30 12:33:19 +0000
committerRichard M. Stallman2003-09-30 12:33:19 +0000
commit34894ec3c701c36b964b3afd804688909136881e (patch)
tree42763ee7a01b9bf6534cb4bd4e4918175766c031 /src
parentcb049c411e04f414a0854cd705cd299d111e5929 (diff)
downloademacs-34894ec3c701c36b964b3afd804688909136881e.tar.gz
emacs-34894ec3c701c36b964b3afd804688909136881e.zip
(graft_intervals_into_buffer): Handle over_used when splitting UNDER.
Set BUF_INTERVALS (buffer)->up_obj when appropriate.
Diffstat (limited to 'src')
-rw-r--r--src/intervals.c6
1 files changed, 4 insertions, 2 deletions
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)
1746 XSETBUFFER (buf, buffer); 1746 XSETBUFFER (buf, buffer);
1747 BUF_INTERVALS (buffer) = reproduce_tree_obj (source, buf); 1747 BUF_INTERVALS (buffer) = reproduce_tree_obj (source, buf);
1748 BUF_INTERVALS (buffer)->position = BEG; 1748 BUF_INTERVALS (buffer)->position = BEG;
1749 BUF_INTERVALS (buffer)->up_obj = 1;
1749 1750
1750 /* Explicitly free the old tree here? */ 1751 /* Explicitly free the old tree here? */
1751 1752
@@ -1768,6 +1769,7 @@ graft_intervals_into_buffer (source, position, length, buffer, inherit)
1768 { 1769 {
1769 BUF_INTERVALS (buffer) = reproduce_tree (source, INTERVAL_PARENT (tree)); 1770 BUF_INTERVALS (buffer) = reproduce_tree (source, INTERVAL_PARENT (tree));
1770 BUF_INTERVALS (buffer)->position = BEG; 1771 BUF_INTERVALS (buffer)->position = BEG;
1772 BUF_INTERVALS (buffer)->up_obj = 1;
1771 /* Explicitly free the old tree here. */ 1773 /* Explicitly free the old tree here. */
1772 1774
1773 return; 1775 return;
@@ -1823,9 +1825,9 @@ graft_intervals_into_buffer (source, position, length, buffer, inherit)
1823 while (! NULL_INTERVAL_P (over)) 1825 while (! NULL_INTERVAL_P (over))
1824 { 1826 {
1825 /* If UNDER is longer than OVER, split it. */ 1827 /* If UNDER is longer than OVER, split it. */
1826 if (LENGTH (over) < LENGTH (under)) 1828 if (LENGTH (over) - over_used < LENGTH (under))
1827 { 1829 {
1828 this = split_interval_left (under, LENGTH (over)); 1830 this = split_interval_left (under, LENGTH (over) - over_used);
1829 copy_properties (under, this); 1831 copy_properties (under, this);
1830 } 1832 }
1831 else 1833 else