aboutsummaryrefslogtreecommitdiffstats
path: root/src/intervals.c
diff options
context:
space:
mode:
authorJuanma Barranquero2002-10-18 10:09:43 +0000
committerJuanma Barranquero2002-10-18 10:09:43 +0000
commit7d0393cf12f2e50ee50e1a1fd73a60e9ef1f56ac (patch)
tree2331486f0c145e370d029e273961af152c190c65 /src/intervals.c
parentd49e7392f87656dfddf7a529fc7d312898524130 (diff)
downloademacs-7d0393cf12f2e50ee50e1a1fd73a60e9ef1f56ac.tar.gz
emacs-7d0393cf12f2e50ee50e1a1fd73a60e9ef1f56ac.zip
Fix typo in comment.
Diffstat (limited to 'src/intervals.c')
-rw-r--r--src/intervals.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/intervals.c b/src/intervals.c
index 9ed2a651f55..3b8327b96d8 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -347,10 +347,10 @@ rotate_right (interval)
347 347
348/* Assuming that a right child exists, perform the following operation: 348/* Assuming that a right child exists, perform the following operation:
349 349
350 A B 350 A B
351 / \ / \ 351 / \ / \
352 B => A 352 B => A
353 / \ / \ 353 / \ / \
354 c c 354 c c
355*/ 355*/
356 356
@@ -524,7 +524,7 @@ split_interval_right (interval, offset)
524 new->total_length = new_length + new->right->total_length; 524 new->total_length = new_length + new->right->total_length;
525 balance_an_interval (new); 525 balance_an_interval (new);
526 } 526 }
527 527
528 balance_possible_root_interval (interval); 528 balance_possible_root_interval (interval);
529 529
530 return new; 530 return new;
@@ -569,7 +569,7 @@ split_interval_left (interval, offset)
569 new->total_length = new_length + new->left->total_length; 569 new->total_length = new_length + new->left->total_length;
570 balance_an_interval (new); 570 balance_an_interval (new);
571 } 571 }
572 572
573 balance_possible_root_interval (interval); 573 balance_possible_root_interval (interval);
574 574
575 return new; 575 return new;
@@ -754,39 +754,39 @@ update_interval (i, pos)
754 if (NULL_INTERVAL_P (i)) 754 if (NULL_INTERVAL_P (i))
755 return NULL_INTERVAL; 755 return NULL_INTERVAL;
756 756
757 while (1) 757 while (1)
758 { 758 {
759 if (pos < i->position) 759 if (pos < i->position)
760 { 760 {
761 /* Move left. */ 761 /* Move left. */
762 if (pos >= i->position - TOTAL_LENGTH (i->left)) 762 if (pos >= i->position - TOTAL_LENGTH (i->left))
763 { 763 {
764 i->left->position = i->position - TOTAL_LENGTH (i->left) 764 i->left->position = i->position - TOTAL_LENGTH (i->left)
765 + LEFT_TOTAL_LENGTH (i->left); 765 + LEFT_TOTAL_LENGTH (i->left);
766 i = i->left; /* Move to the left child */ 766 i = i->left; /* Move to the left child */
767 } 767 }
768 else if (NULL_PARENT (i)) 768 else if (NULL_PARENT (i))
769 error ("Point before start of properties"); 769 error ("Point before start of properties");
770 else 770 else
771 i = INTERVAL_PARENT (i); 771 i = INTERVAL_PARENT (i);
772 continue; 772 continue;
773 } 773 }
774 else if (pos >= INTERVAL_LAST_POS (i)) 774 else if (pos >= INTERVAL_LAST_POS (i))
775 { 775 {
776 /* Move right. */ 776 /* Move right. */
777 if (pos < INTERVAL_LAST_POS (i) + TOTAL_LENGTH (i->right)) 777 if (pos < INTERVAL_LAST_POS (i) + TOTAL_LENGTH (i->right))
778 { 778 {
779 i->right->position = INTERVAL_LAST_POS (i) + 779 i->right->position = INTERVAL_LAST_POS (i) +
780 LEFT_TOTAL_LENGTH (i->right); 780 LEFT_TOTAL_LENGTH (i->right);
781 i = i->right; /* Move to the right child */ 781 i = i->right; /* Move to the right child */
782 } 782 }
783 else if (NULL_PARENT (i)) 783 else if (NULL_PARENT (i))
784 error ("Point after end of properties"); 784 error ("Point after end of properties");
785 else 785 else
786 i = INTERVAL_PARENT (i); 786 i = INTERVAL_PARENT (i);
787 continue; 787 continue;
788 } 788 }
789 else 789 else
790 return i; 790 return i;
791 } 791 }
792} 792}
@@ -874,7 +874,7 @@ adjust_intervals_for_insertion (tree, position, length)
874 int eobp = 0; 874 int eobp = 0;
875 Lisp_Object parent; 875 Lisp_Object parent;
876 int offset; 876 int offset;
877 877
878 if (TOTAL_LENGTH (tree) == 0) /* Paranoia */ 878 if (TOTAL_LENGTH (tree) == 0) /* Paranoia */
879 abort (); 879 abort ();
880 880
@@ -989,7 +989,7 @@ adjust_intervals_for_insertion (tree, position, length)
989 temp->total_length += length; 989 temp->total_length += length;
990 temp = balance_possible_root_interval (temp); 990 temp = balance_possible_root_interval (temp);
991 } 991 }
992 992
993 /* If at least one interval has sticky properties, 993 /* If at least one interval has sticky properties,
994 we check the stickiness property by property. 994 we check the stickiness property by property.
995 995
@@ -1046,7 +1046,7 @@ adjust_intervals_for_insertion (tree, position, length)
1046 temp = balance_possible_root_interval (temp); 1046 temp = balance_possible_root_interval (temp);
1047 } 1047 }
1048 } 1048 }
1049 1049
1050 return tree; 1050 return tree;
1051} 1051}
1052 1052
@@ -1212,7 +1212,7 @@ merge_properties_sticky (pleft, pright)
1212 1212
1213 cat = textget (props, Qcategory); 1213 cat = textget (props, Qcategory);
1214 if (! NILP (front) 1214 if (! NILP (front)
1215 && 1215 &&
1216 /* If we have inherited a front-stick category property that is t, 1216 /* If we have inherited a front-stick category property that is t,
1217 we don't need to set up a detailed one. */ 1217 we don't need to set up a detailed one. */
1218 ! (! NILP (cat) && SYMBOLP (cat) 1218 ! (! NILP (cat) && SYMBOLP (cat)
@@ -1222,7 +1222,7 @@ merge_properties_sticky (pleft, pright)
1222} 1222}
1223 1223
1224 1224
1225/* Delete an node I from its interval tree by merging its subtrees 1225/* Delete a node I from its interval tree by merging its subtrees
1226 into one subtree which is then returned. Caller is responsible for 1226 into one subtree which is then returned. Caller is responsible for
1227 storing the resulting subtree into its parent. */ 1227 storing the resulting subtree into its parent. */
1228 1228
@@ -1351,7 +1351,7 @@ interval_deletion_adjustment (tree, from, amount)
1351 else 1351 else
1352 { 1352 {
1353 /* How much can we delete from this interval? */ 1353 /* How much can we delete from this interval? */
1354 int my_amount = ((tree->total_length 1354 int my_amount = ((tree->total_length
1355 - RIGHT_TOTAL_LENGTH (tree)) 1355 - RIGHT_TOTAL_LENGTH (tree))
1356 - relative_position); 1356 - relative_position);
1357 1357
@@ -1361,7 +1361,7 @@ interval_deletion_adjustment (tree, from, amount)
1361 tree->total_length -= amount; 1361 tree->total_length -= amount;
1362 if (LENGTH (tree) == 0) 1362 if (LENGTH (tree) == 0)
1363 delete_interval (tree); 1363 delete_interval (tree);
1364 1364
1365 return amount; 1365 return amount;
1366 } 1366 }
1367 1367
@@ -1780,7 +1780,7 @@ graft_intervals_into_buffer (source, position, length, buffer, inherit)
1780 The properties of under are the result of 1780 The properties of under are the result of
1781 adjust_intervals_for_insertion, so stickiness has 1781 adjust_intervals_for_insertion, so stickiness has
1782 already been taken care of. */ 1782 already been taken care of. */
1783 1783
1784 while (! NULL_INTERVAL_P (over)) 1784 while (! NULL_INTERVAL_P (over))
1785 { 1785 {
1786 if (LENGTH (over) < LENGTH (under)) 1786 if (LENGTH (over) < LENGTH (under))
@@ -1805,7 +1805,7 @@ graft_intervals_into_buffer (source, position, length, buffer, inherit)
1805 1805
1806/* Get the value of property PROP from PLIST, 1806/* Get the value of property PROP from PLIST,
1807 which is the plist of an interval. 1807 which is the plist of an interval.
1808 We check for direct properties, for categories with property PROP, 1808 We check for direct properties, for categories with property PROP,
1809 and for PROP appearing on the default-text-properties list. */ 1809 and for PROP appearing on the default-text-properties list. */
1810 1810
1811Lisp_Object 1811Lisp_Object
@@ -1887,7 +1887,7 @@ temp_set_point_both (buffer, charpos, bytepos)
1887 BUF_PT (buffer) = charpos; 1887 BUF_PT (buffer) = charpos;
1888} 1888}
1889 1889
1890/* Set point in BUFFER to CHARPOS. If the target position is 1890/* Set point in BUFFER to CHARPOS. If the target position is
1891 before an intangible character, move to an ok place. */ 1891 before an intangible character, move to an ok place. */
1892 1892
1893void 1893void
@@ -1907,7 +1907,7 @@ set_point (buffer, charpos)
1907 TEST_OFFS should be either 0 or -1, and ADJ should be either 1 or -1. 1907 TEST_OFFS should be either 0 or -1, and ADJ should be either 1 or -1.
1908 1908
1909 Note that `stickiness' is determined by overlay marker insertion types, 1909 Note that `stickiness' is determined by overlay marker insertion types,
1910 if the invisible property comes from an overlay. */ 1910 if the invisible property comes from an overlay. */
1911 1911
1912static int 1912static int
1913adjust_for_invis_intang (pos, test_offs, adj, test_intang) 1913adjust_for_invis_intang (pos, test_offs, adj, test_intang)
@@ -1945,7 +1945,7 @@ adjust_for_invis_intang (pos, test_offs, adj, test_intang)
1945} 1945}
1946 1946
1947/* Set point in BUFFER to CHARPOS, which corresponds to byte 1947/* Set point in BUFFER to CHARPOS, which corresponds to byte
1948 position BYTEPOS. If the target position is 1948 position BYTEPOS. If the target position is
1949 before an intangible character, move to an ok place. */ 1949 before an intangible character, move to an ok place. */
1950 1950
1951void 1951void
@@ -2218,7 +2218,7 @@ move_if_not_intangible (position)
2218 2218
2219 } 2219 }
2220 2220
2221 /* If the whole stretch between PT and POSITION isn't intangible, 2221 /* If the whole stretch between PT and POSITION isn't intangible,
2222 try moving to POSITION (which means we actually move farther 2222 try moving to POSITION (which means we actually move farther
2223 if POSITION is inside of intangible text). */ 2223 if POSITION is inside of intangible text). */
2224 2224
@@ -2265,7 +2265,7 @@ get_property_and_range (pos, prop, val, start, end, object)
2265 *start = i->position; 2265 *start = i->position;
2266 2266
2267 next = next_interval (i); 2267 next = next_interval (i);
2268 while (! NULL_INTERVAL_P (next) 2268 while (! NULL_INTERVAL_P (next)
2269 && EQ (*val, textget (next->plist, prop))) 2269 && EQ (*val, textget (next->plist, prop)))
2270 i = next, next = next_interval (next); 2270 i = next, next = next_interval (next);
2271 *end = i->position + LENGTH (i); 2271 *end = i->position + LENGTH (i);