Changeset 4085 for trunk/src/textprop.c
- Timestamp:
- 05/18/06 16:19:18 (3 years ago)
- Files:
-
- trunk/src/textprop.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/textprop.c
r4073 r4085 718 718 it finds a change in some text property, or the beginning or end of an 719 719 overlay, and returns the position of that. 720 If none is found , the function returns (point-max).720 If none is found up to (point-max), the function returns (point-max). 721 721 722 722 If the optional second argument LIMIT is non-nil, don't search 723 past position LIMIT; return LIMIT if nothing is found before LIMIT. */) 723 past position LIMIT; return LIMIT if nothing is found before LIMIT. 724 LIMIT is a no-op if it is greater than (point-max). */) 724 725 (position, limit) 725 726 Lisp_Object position, limit; … … 743 744 finds a change in some text property, or the beginning or end of an 744 745 overlay, and returns the position of that. 745 If none is found , the function returns (point-max).746 If none is found since (point-min), the function returns (point-min). 746 747 747 748 If the optional second argument LIMIT is non-nil, don't search 748 past position LIMIT; return LIMIT if nothing is found before LIMIT. */) 749 past position LIMIT; return LIMIT if nothing is found before LIMIT. 750 LIMIT is a no-op if it is less than (point-min). */) 749 751 (position, limit) 750 752 Lisp_Object position, limit; … … 772 774 If OBJECT is a string, POSITION is a 0-based index into it. 773 775 776 In a string, scan runs to the end of the string. 777 In a buffer, it runs to (point-max), and the value cannot exceed that. 778 774 779 The property values are compared with `eq'. 775 780 If the property is constant all the way to the end of OBJECT, return the … … 813 818 814 819 if (NILP (limit)) 815 XSETFASTINT (limit, BUF_ZV (current_buffer));820 XSETFASTINT (limit, ZV); 816 821 else 817 822 CHECK_NUMBER_COERCE_MARKER (limit); 818 823 819 for (;;) 820 { 821 position = Fnext_char_property_change (position, limit); 822 if (XFASTINT (position) >= XFASTINT (limit)) { 823 position = limit; 824 break; 824 if (XFASTINT (position) >= XFASTINT (limit)) 825 { 826 position = limit; 827 if (XFASTINT (position) > ZV) 828 XSETFASTINT (position, ZV); 829 } 830 else 831 while (1) 832 { 833 position = Fnext_char_property_change (position, limit); 834 if (XFASTINT (position) >= XFASTINT (limit)) 835 { 836 position = limit; 837 break; 838 } 839 840 value = Fget_char_property (position, prop, object); 841 if (!EQ (value, initial_value)) 842 break; 825 843 } 826 827 value = Fget_char_property (position, prop, object);828 if (!EQ (value, initial_value))829 break;830 }831 844 832 845 unbind_to (count, Qnil); … … 846 859 If OBJECT is a string, POSITION is a 0-based index into it. 847 860 861 In a string, scan runs to the start of the string. 862 In a buffer, it runs to (point-min), and the value cannot be less than that. 863 848 864 The property values are compared with `eq'. 849 865 If the property is constant all the way to the start of OBJECT, return the … … 884 900 885 901 if (NILP (limit)) 886 XSETFASTINT (limit, B UF_BEGV (current_buffer));902 XSETFASTINT (limit, BEGV); 887 903 else 888 904 CHECK_NUMBER_COERCE_MARKER (limit); 889 905 890 906 if (XFASTINT (position) <= XFASTINT (limit)) 891 position = limit; 907 { 908 position = limit; 909 if (XFASTINT (position) < BEGV) 910 XSETFASTINT (position, BEGV); 911 } 892 912 else 893 913 { 894 Lisp_Object initial_value =895 Fget_char_property (make_number (XFASTINT (position) - 1),896 prop, object);897 898 for (;;)914 Lisp_Object initial_value 915 = Fget_char_property (make_number (XFASTINT (position) - 1), 916 prop, object); 917 918 while (1) 899 919 { 900 920 position = Fprevious_char_property_change (position, limit); … … 907 927 else 908 928 { 909 Lisp_Object value =910 Fget_char_property (make_number (XFASTINT (position) - 1),911 prop, object);929 Lisp_Object value 930 = Fget_char_property (make_number (XFASTINT (position) - 1), 931 prop, object); 912 932 913 933 if (!EQ (value, initial_value))
