diff options
| author | Karl Heuer | 1998-05-29 22:26:22 +0000 |
|---|---|---|
| committer | Karl Heuer | 1998-05-29 22:26:22 +0000 |
| commit | 17cea80917206c92bd0029bd620bd718926eae9c (patch) | |
| tree | b09eab0c38164897744993781a2b7c5cd5f3fa05 | |
| parent | aaf3523422e1249eeb568236c16f21c444c35157 (diff) | |
| download | emacs-17cea80917206c92bd0029bd620bd718926eae9c.tar.gz emacs-17cea80917206c92bd0029bd620bd718926eae9c.zip | |
(Fnext_property_change): Properly offset interval
position for string when comparing with LIMIT.
(property_change_between_p): Likewise.
(Fnext_single_property_change, Fprevious_property_change): Likewise.
(Fprevious_single_property_change): Likewise.
| -rw-r--r-- | src/textprop.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/src/textprop.c b/src/textprop.c index 26d06cd7659..0309f8c2d9d 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -726,12 +726,14 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT.") | |||
| 726 | next = next_interval (i); | 726 | next = next_interval (i); |
| 727 | 727 | ||
| 728 | while (! NULL_INTERVAL_P (next) && intervals_equal (i, next) | 728 | while (! NULL_INTERVAL_P (next) && intervals_equal (i, next) |
| 729 | && (NILP (limit) || next->position < XFASTINT (limit))) | 729 | && (NILP (limit) |
| 730 | || next->position - (STRINGP (object)) < XFASTINT (limit))) | ||
| 730 | next = next_interval (next); | 731 | next = next_interval (next); |
| 731 | 732 | ||
| 732 | if (NULL_INTERVAL_P (next)) | 733 | if (NULL_INTERVAL_P (next)) |
| 733 | return limit; | 734 | return limit; |
| 734 | if (! NILP (limit) && !(next->position < XFASTINT (limit))) | 735 | if (! NILP (limit) |
| 736 | && !(next->position - (STRINGP (object)) < XFASTINT (limit))) | ||
| 735 | return limit; | 737 | return limit; |
| 736 | 738 | ||
| 737 | XSETFASTINT (position, next->position - (STRINGP (object))); | 739 | XSETFASTINT (position, next->position - (STRINGP (object))); |
| @@ -760,7 +762,7 @@ property_change_between_p (beg, end) | |||
| 760 | next = next_interval (next); | 762 | next = next_interval (next); |
| 761 | if (NULL_INTERVAL_P (next)) | 763 | if (NULL_INTERVAL_P (next)) |
| 762 | return 0; | 764 | return 0; |
| 763 | if (next->position >= end) | 765 | if (next->position - (STRINGP (object)) >= end) |
| 764 | return 0; | 766 | return 0; |
| 765 | } | 767 | } |
| 766 | 768 | ||
| @@ -801,12 +803,13 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT.") | |||
| 801 | next = next_interval (i); | 803 | next = next_interval (i); |
| 802 | while (! NULL_INTERVAL_P (next) | 804 | while (! NULL_INTERVAL_P (next) |
| 803 | && EQ (here_val, textget (next->plist, prop)) | 805 | && EQ (here_val, textget (next->plist, prop)) |
| 804 | && (NILP (limit) || next->position < XFASTINT (limit))) | 806 | && (NILP (limit) || next->position - (STRINGP (object)) < XFASTINT (limit))) |
| 805 | next = next_interval (next); | 807 | next = next_interval (next); |
| 806 | 808 | ||
| 807 | if (NULL_INTERVAL_P (next)) | 809 | if (NULL_INTERVAL_P (next)) |
| 808 | return limit; | 810 | return limit; |
| 809 | if (! NILP (limit) && !(next->position < XFASTINT (limit))) | 811 | if (! NILP (limit) |
| 812 | && !(next->position - (STRINGP (object)) < XFASTINT (limit))) | ||
| 810 | return limit; | 813 | return limit; |
| 811 | 814 | ||
| 812 | XSETFASTINT (position, next->position - (STRINGP (object))); | 815 | XSETFASTINT (position, next->position - (STRINGP (object))); |
| @@ -845,16 +848,18 @@ back past position LIMIT; return LIMIT if nothing is found until LIMIT.") | |||
| 845 | previous = previous_interval (i); | 848 | previous = previous_interval (i); |
| 846 | while (! NULL_INTERVAL_P (previous) && intervals_equal (previous, i) | 849 | while (! NULL_INTERVAL_P (previous) && intervals_equal (previous, i) |
| 847 | && (NILP (limit) | 850 | && (NILP (limit) |
| 848 | || previous->position + LENGTH (previous) > XFASTINT (limit))) | 851 | || (previous->position + LENGTH (previous) - (STRINGP (object)) |
| 852 | > XFASTINT (limit)))) | ||
| 849 | previous = previous_interval (previous); | 853 | previous = previous_interval (previous); |
| 850 | if (NULL_INTERVAL_P (previous)) | 854 | if (NULL_INTERVAL_P (previous)) |
| 851 | return limit; | 855 | return limit; |
| 852 | if (!NILP (limit) | 856 | if (!NILP (limit) |
| 853 | && !(previous->position + LENGTH (previous) > XFASTINT (limit))) | 857 | && !(previous->position + LENGTH (previous) - (STRINGP (object)) |
| 858 | > XFASTINT (limit))) | ||
| 854 | return limit; | 859 | return limit; |
| 855 | 860 | ||
| 856 | XSETFASTINT (position, (previous->position + LENGTH (previous) | 861 | XSETFASTINT (position, (previous->position + LENGTH (previous) |
| 857 | - (STRINGP (object)))); | 862 | - (STRINGP (object)))); |
| 858 | return position; | 863 | return position; |
| 859 | } | 864 | } |
| 860 | 865 | ||
| @@ -895,16 +900,18 @@ back past position LIMIT; return LIMIT if nothing is found until LIMIT.") | |||
| 895 | while (! NULL_INTERVAL_P (previous) | 900 | while (! NULL_INTERVAL_P (previous) |
| 896 | && EQ (here_val, textget (previous->plist, prop)) | 901 | && EQ (here_val, textget (previous->plist, prop)) |
| 897 | && (NILP (limit) | 902 | && (NILP (limit) |
| 898 | || previous->position + LENGTH (previous) > XFASTINT (limit))) | 903 | || (previous->position + LENGTH (previous) - (STRINGP (object)) |
| 904 | > XFASTINT (limit)))) | ||
| 899 | previous = previous_interval (previous); | 905 | previous = previous_interval (previous); |
| 900 | if (NULL_INTERVAL_P (previous)) | 906 | if (NULL_INTERVAL_P (previous)) |
| 901 | return limit; | 907 | return limit; |
| 902 | if (!NILP (limit) | 908 | if (!NILP (limit) |
| 903 | && !(previous->position + LENGTH (previous) > XFASTINT (limit))) | 909 | && !(previous->position + LENGTH (previous) - (STRINGP (object)) |
| 910 | > XFASTINT (limit))) | ||
| 904 | return limit; | 911 | return limit; |
| 905 | 912 | ||
| 906 | XSETFASTINT (position, (previous->position + LENGTH (previous) | 913 | XSETFASTINT (position, (previous->position + LENGTH (previous) |
| 907 | - (STRINGP (object)))); | 914 | - (STRINGP (object)))); |
| 908 | return position; | 915 | return position; |
| 909 | } | 916 | } |
| 910 | 917 | ||