diff options
| author | Francesco Potortì | 2003-01-14 23:13:05 +0000 |
|---|---|---|
| committer | Francesco Potortì | 2003-01-14 23:13:05 +0000 |
| commit | 81f6e55f76cfc735cc28f3d85802311007808e89 (patch) | |
| tree | b748ce9c34b28ab22c84e3126b5cb6ae602563cc /src | |
| parent | 91f78c999ebdb8c8d80829616ab57eb82e684fff (diff) | |
| download | emacs-81f6e55f76cfc735cc28f3d85802311007808e89.tar.gz emacs-81f6e55f76cfc735cc28f3d85802311007808e89.zip | |
(Ftext_properties_at, Fnext_char_property_change)
(Fprevious_char_property_change)
(Fnext_single_char_property_change)
(Fprevious_single_char_property_change, Fnext_property_change)
(Fnext_single_property_change, Fprevious_property_change)
(Fprevious_single_property_change, Fadd_text_properties)
(Fput_text_property, Fset_text_properties)
(Fremove_text_properties, Fremove_list_of_text_properties)
(Ftext_property_any, Ftext_property_not_all): Clarify doc strings.
Diffstat (limited to 'src')
| -rw-r--r-- | src/textprop.c | 136 |
1 files changed, 79 insertions, 57 deletions
diff --git a/src/textprop.c b/src/textprop.c index 745f6b7fb90..176607c5de4 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -177,7 +177,7 @@ validate_interval_range (object, begin, end, force) | |||
| 177 | 177 | ||
| 178 | if (NULL_INTERVAL_P (i)) | 178 | if (NULL_INTERVAL_P (i)) |
| 179 | return (force ? create_root_interval (object) : i); | 179 | return (force ? create_root_interval (object) : i); |
| 180 | 180 | ||
| 181 | return find_interval (i, searchpos); | 181 | return find_interval (i, searchpos); |
| 182 | } | 182 | } |
| 183 | 183 | ||
| @@ -526,7 +526,7 @@ erase_properties (i) | |||
| 526 | } | 526 | } |
| 527 | #endif | 527 | #endif |
| 528 | 528 | ||
| 529 | /* Returns the interval of POSITION in OBJECT. | 529 | /* Returns the interval of POSITION in OBJECT. |
| 530 | POSITION is BEG-based. */ | 530 | POSITION is BEG-based. */ |
| 531 | 531 | ||
| 532 | INTERVAL | 532 | INTERVAL |
| @@ -563,15 +563,16 @@ interval_of (position, object) | |||
| 563 | args_out_of_range (make_number (position), make_number (position)); | 563 | args_out_of_range (make_number (position), make_number (position)); |
| 564 | if (beg == end || NULL_INTERVAL_P (i)) | 564 | if (beg == end || NULL_INTERVAL_P (i)) |
| 565 | return NULL_INTERVAL; | 565 | return NULL_INTERVAL; |
| 566 | 566 | ||
| 567 | return find_interval (i, position); | 567 | return find_interval (i, position); |
| 568 | } | 568 | } |
| 569 | 569 | ||
| 570 | DEFUN ("text-properties-at", Ftext_properties_at, | 570 | DEFUN ("text-properties-at", Ftext_properties_at, |
| 571 | Stext_properties_at, 1, 2, 0, | 571 | Stext_properties_at, 1, 2, 0, |
| 572 | doc: /* Return the list of properties of the character at POSITION in OBJECT. | 572 | doc: /* Return the list of properties of the character at POSITION in OBJECT. |
| 573 | OBJECT is the string or buffer to look for the properties in; | 573 | If the optional second argument OBJECT is a buffer (or nil, which means |
| 574 | nil means the current buffer. | 574 | the current buffer), POSITION is a buffer position (integer or marker). |
| 575 | If OBJECT is a string, POSITION is a 0-based index into it. | ||
| 575 | If POSITION is at the end of OBJECT, the value is nil. */) | 576 | If POSITION is at the end of OBJECT, the value is nil. */) |
| 576 | (position, object) | 577 | (position, object) |
| 577 | Lisp_Object position, object; | 578 | Lisp_Object position, object; |
| @@ -706,9 +707,9 @@ overlays are considered only if they are associated with OBJECT. */) | |||
| 706 | DEFUN ("next-char-property-change", Fnext_char_property_change, | 707 | DEFUN ("next-char-property-change", Fnext_char_property_change, |
| 707 | Snext_char_property_change, 1, 2, 0, | 708 | Snext_char_property_change, 1, 2, 0, |
| 708 | doc: /* Return the position of next text property or overlay change. | 709 | doc: /* Return the position of next text property or overlay change. |
| 709 | This scans characters forward from POSITION till it finds a change in | 710 | This scans characters forward in the current buffer from POSITION till |
| 710 | some text property, or the beginning or end of an overlay, and returns | 711 | it finds a change in some text property, or the beginning or end of an |
| 711 | the position of that. | 712 | overlay, and returns the position of that. |
| 712 | If none is found, the function returns (point-max). | 713 | If none is found, the function returns (point-max). |
| 713 | 714 | ||
| 714 | If the optional third argument LIMIT is non-nil, don't search | 715 | If the optional third argument LIMIT is non-nil, don't search |
| @@ -731,9 +732,9 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 731 | DEFUN ("previous-char-property-change", Fprevious_char_property_change, | 732 | DEFUN ("previous-char-property-change", Fprevious_char_property_change, |
| 732 | Sprevious_char_property_change, 1, 2, 0, | 733 | Sprevious_char_property_change, 1, 2, 0, |
| 733 | doc: /* Return the position of previous text property or overlay change. | 734 | doc: /* Return the position of previous text property or overlay change. |
| 734 | Scans characters backward from POSITION till it finds a change in some | 735 | Scans characters backward in the current buffer from POSITION till it |
| 735 | text property, or the beginning or end of an overlay, and returns the | 736 | finds a change in some text property, or the beginning or end of an |
| 736 | position of that. | 737 | overlay, and returns the position of that. |
| 737 | If none is found, the function returns (point-max). | 738 | If none is found, the function returns (point-max). |
| 738 | 739 | ||
| 739 | If the optional third argument LIMIT is non-nil, don't search | 740 | If the optional third argument LIMIT is non-nil, don't search |
| @@ -759,7 +760,10 @@ DEFUN ("next-single-char-property-change", Fnext_single_char_property_change, | |||
| 759 | doc: /* Return the position of next text property or overlay change for a specific property. | 760 | doc: /* Return the position of next text property or overlay change for a specific property. |
| 760 | Scans characters forward from POSITION till it finds | 761 | Scans characters forward from POSITION till it finds |
| 761 | a change in the PROP property, then returns the position of the change. | 762 | a change in the PROP property, then returns the position of the change. |
| 762 | The optional third argument OBJECT is the string or buffer to scan. | 763 | If the optional third argument OBJECT is a buffer (or nil, which means |
| 764 | the current buffer), POSITION is a buffer position (integer or marker). | ||
| 765 | If OBJECT is a string, POSITION is a 0-based index into it. | ||
| 766 | |||
| 763 | The property values are compared with `eq'. | 767 | The property values are compared with `eq'. |
| 764 | If the property is constant all the way to the end of OBJECT, return the | 768 | If the property is constant all the way to the end of OBJECT, return the |
| 765 | last valid position in OBJECT. | 769 | last valid position in OBJECT. |
| @@ -786,7 +790,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 786 | 790 | ||
| 787 | if (! NILP (object)) | 791 | if (! NILP (object)) |
| 788 | CHECK_BUFFER (object); | 792 | CHECK_BUFFER (object); |
| 789 | 793 | ||
| 790 | if (BUFFERP (object) && current_buffer != XBUFFER (object)) | 794 | if (BUFFERP (object) && current_buffer != XBUFFER (object)) |
| 791 | { | 795 | { |
| 792 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 796 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); |
| @@ -794,7 +798,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 794 | } | 798 | } |
| 795 | 799 | ||
| 796 | initial_value = Fget_char_property (position, prop, object); | 800 | initial_value = Fget_char_property (position, prop, object); |
| 797 | 801 | ||
| 798 | if (NILP (limit)) | 802 | if (NILP (limit)) |
| 799 | XSETFASTINT (limit, BUF_ZV (current_buffer)); | 803 | XSETFASTINT (limit, BUF_ZV (current_buffer)); |
| 800 | else | 804 | else |
| @@ -825,7 +829,10 @@ DEFUN ("previous-single-char-property-change", | |||
| 825 | doc: /* Return the position of previous text property or overlay change for a specific property. | 829 | doc: /* Return the position of previous text property or overlay change for a specific property. |
| 826 | Scans characters backward from POSITION till it finds | 830 | Scans characters backward from POSITION till it finds |
| 827 | a change in the PROP property, then returns the position of the change. | 831 | a change in the PROP property, then returns the position of the change. |
| 828 | The optional third argument OBJECT is the string or buffer to scan. | 832 | If the optional third argument OBJECT is a buffer (or nil, which means |
| 833 | the current buffer), POSITION is a buffer position (integer or marker). | ||
| 834 | If OBJECT is a string, POSITION is a 0-based index into it. | ||
| 835 | |||
| 829 | The property values are compared with `eq'. | 836 | The property values are compared with `eq'. |
| 830 | If the property is constant all the way to the start of OBJECT, return the | 837 | If the property is constant all the way to the start of OBJECT, return the |
| 831 | first valid position in OBJECT. | 838 | first valid position in OBJECT. |
| @@ -851,13 +858,13 @@ back past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 851 | 858 | ||
| 852 | if (! NILP (object)) | 859 | if (! NILP (object)) |
| 853 | CHECK_BUFFER (object); | 860 | CHECK_BUFFER (object); |
| 854 | 861 | ||
| 855 | if (BUFFERP (object) && current_buffer != XBUFFER (object)) | 862 | if (BUFFERP (object) && current_buffer != XBUFFER (object)) |
| 856 | { | 863 | { |
| 857 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 864 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); |
| 858 | Fset_buffer (object); | 865 | Fset_buffer (object); |
| 859 | } | 866 | } |
| 860 | 867 | ||
| 861 | if (NILP (limit)) | 868 | if (NILP (limit)) |
| 862 | XSETFASTINT (limit, BUF_BEGV (current_buffer)); | 869 | XSETFASTINT (limit, BUF_BEGV (current_buffer)); |
| 863 | else | 870 | else |
| @@ -870,7 +877,7 @@ back past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 870 | Lisp_Object initial_value = | 877 | Lisp_Object initial_value = |
| 871 | Fget_char_property (make_number (XFASTINT (position) - 1), | 878 | Fget_char_property (make_number (XFASTINT (position) - 1), |
| 872 | prop, object); | 879 | prop, object); |
| 873 | 880 | ||
| 874 | for (;;) | 881 | for (;;) |
| 875 | { | 882 | { |
| 876 | position = Fprevious_char_property_change (position, limit); | 883 | position = Fprevious_char_property_change (position, limit); |
| @@ -903,7 +910,9 @@ DEFUN ("next-property-change", Fnext_property_change, | |||
| 903 | doc: /* Return the position of next property change. | 910 | doc: /* Return the position of next property change. |
| 904 | Scans characters forward from POSITION in OBJECT till it finds | 911 | Scans characters forward from POSITION in OBJECT till it finds |
| 905 | a change in some text property, then returns the position of the change. | 912 | a change in some text property, then returns the position of the change. |
| 906 | The optional second argument OBJECT is the string or buffer to scan. | 913 | If the optional second argument OBJECT is a buffer (or nil, which means |
| 914 | the current buffer), POSITION is a buffer position (integer or marker). | ||
| 915 | If OBJECT is a string, POSITION is a 0-based index into it. | ||
| 907 | Return nil if the property is constant all the way to the end of OBJECT. | 916 | Return nil if the property is constant all the way to the end of OBJECT. |
| 908 | If the value is non-nil, it is a position greater than POSITION, never equal. | 917 | If the value is non-nil, it is a position greater than POSITION, never equal. |
| 909 | 918 | ||
| @@ -930,7 +939,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 930 | next = i; | 939 | next = i; |
| 931 | else | 940 | else |
| 932 | next = next_interval (i); | 941 | next = next_interval (i); |
| 933 | 942 | ||
| 934 | if (NULL_INTERVAL_P (next)) | 943 | if (NULL_INTERVAL_P (next)) |
| 935 | XSETFASTINT (position, (STRINGP (object) | 944 | XSETFASTINT (position, (STRINGP (object) |
| 936 | ? SCHARS (object) | 945 | ? SCHARS (object) |
| @@ -999,7 +1008,9 @@ DEFUN ("next-single-property-change", Fnext_single_property_change, | |||
| 999 | doc: /* Return the position of next property change for a specific property. | 1008 | doc: /* Return the position of next property change for a specific property. |
| 1000 | Scans characters forward from POSITION till it finds | 1009 | Scans characters forward from POSITION till it finds |
| 1001 | a change in the PROP property, then returns the position of the change. | 1010 | a change in the PROP property, then returns the position of the change. |
| 1002 | The optional third argument OBJECT is the string or buffer to scan. | 1011 | If the optional third argument OBJECT is a buffer (or nil, which means |
| 1012 | the current buffer), POSITION is a buffer position (integer or marker). | ||
| 1013 | If OBJECT is a string, POSITION is a 0-based index into it. | ||
| 1003 | The property values are compared with `eq'. | 1014 | The property values are compared with `eq'. |
| 1004 | Return nil if the property is constant all the way to the end of OBJECT. | 1015 | Return nil if the property is constant all the way to the end of OBJECT. |
| 1005 | If the value is non-nil, it is a position greater than POSITION, never equal. | 1016 | If the value is non-nil, it is a position greater than POSITION, never equal. |
| @@ -1024,7 +1035,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 1024 | 1035 | ||
| 1025 | here_val = textget (i->plist, prop); | 1036 | here_val = textget (i->plist, prop); |
| 1026 | next = next_interval (i); | 1037 | next = next_interval (i); |
| 1027 | while (! NULL_INTERVAL_P (next) | 1038 | while (! NULL_INTERVAL_P (next) |
| 1028 | && EQ (here_val, textget (next->plist, prop)) | 1039 | && EQ (here_val, textget (next->plist, prop)) |
| 1029 | && (NILP (limit) || next->position < XFASTINT (limit))) | 1040 | && (NILP (limit) || next->position < XFASTINT (limit))) |
| 1030 | next = next_interval (next); | 1041 | next = next_interval (next); |
| @@ -1046,7 +1057,9 @@ DEFUN ("previous-property-change", Fprevious_property_change, | |||
| 1046 | doc: /* Return the position of previous property change. | 1057 | doc: /* Return the position of previous property change. |
| 1047 | Scans characters backwards from POSITION in OBJECT till it finds | 1058 | Scans characters backwards from POSITION in OBJECT till it finds |
| 1048 | a change in some text property, then returns the position of the change. | 1059 | a change in some text property, then returns the position of the change. |
| 1049 | The optional second argument OBJECT is the string or buffer to scan. | 1060 | If the optional second argument OBJECT is a buffer (or nil, which means |
| 1061 | the current buffer), POSITION is a buffer position (integer or marker). | ||
| 1062 | If OBJECT is a string, POSITION is a 0-based index into it. | ||
| 1050 | Return nil if the property is constant all the way to the start of OBJECT. | 1063 | Return nil if the property is constant all the way to the start of OBJECT. |
| 1051 | If the value is non-nil, it is a position less than POSITION, never equal. | 1064 | If the value is non-nil, it is a position less than POSITION, never equal. |
| 1052 | 1065 | ||
| @@ -1091,7 +1104,9 @@ DEFUN ("previous-single-property-change", Fprevious_single_property_change, | |||
| 1091 | doc: /* Return the position of previous property change for a specific property. | 1104 | doc: /* Return the position of previous property change for a specific property. |
| 1092 | Scans characters backward from POSITION till it finds | 1105 | Scans characters backward from POSITION till it finds |
| 1093 | a change in the PROP property, then returns the position of the change. | 1106 | a change in the PROP property, then returns the position of the change. |
| 1094 | The optional third argument OBJECT is the string or buffer to scan. | 1107 | If the optional third argument OBJECT is a buffer (or nil, which means |
| 1108 | the current buffer), POSITION is a buffer position (integer or marker). | ||
| 1109 | If OBJECT is a string, POSITION is a 0-based index into it. | ||
| 1095 | The property values are compared with `eq'. | 1110 | The property values are compared with `eq'. |
| 1096 | Return nil if the property is constant all the way to the start of OBJECT. | 1111 | Return nil if the property is constant all the way to the start of OBJECT. |
| 1097 | If the value is non-nil, it is a position less than POSITION, never equal. | 1112 | If the value is non-nil, it is a position less than POSITION, never equal. |
| @@ -1142,9 +1157,10 @@ DEFUN ("add-text-properties", Fadd_text_properties, | |||
| 1142 | Sadd_text_properties, 3, 4, 0, | 1157 | Sadd_text_properties, 3, 4, 0, |
| 1143 | doc: /* Add properties to the text from START to END. | 1158 | doc: /* Add properties to the text from START to END. |
| 1144 | The third argument PROPERTIES is a property list | 1159 | The third argument PROPERTIES is a property list |
| 1145 | specifying the property values to add. | 1160 | specifying the property values to add. If the optional fourth argument |
| 1146 | The optional fourth argument, OBJECT, | 1161 | OBJECT is a buffer (or nil, which means the current buffer), |
| 1147 | is the string or buffer containing the text. | 1162 | START and END are buffer positions (integers or markers). |
| 1163 | If OBJECT is a string, START and END are 0-based indices into it. | ||
| 1148 | Return t if any property value actually changed, nil otherwise. */) | 1164 | Return t if any property value actually changed, nil otherwise. */) |
| 1149 | (start, end, properties, object) | 1165 | (start, end, properties, object) |
| 1150 | Lisp_Object start, end, properties, object; | 1166 | Lisp_Object start, end, properties, object; |
| @@ -1251,8 +1267,9 @@ DEFUN ("put-text-property", Fput_text_property, | |||
| 1251 | doc: /* Set one property of the text from START to END. | 1267 | doc: /* Set one property of the text from START to END. |
| 1252 | The third and fourth arguments PROPERTY and VALUE | 1268 | The third and fourth arguments PROPERTY and VALUE |
| 1253 | specify the property to add. | 1269 | specify the property to add. |
| 1254 | The optional fifth argument, OBJECT, | 1270 | If the optional fifth argument OBJECT is a buffer (or nil, which means |
| 1255 | is the string or buffer containing the text. */) | 1271 | the current buffer), START and END are buffer positions (integers or |
| 1272 | markers). If OBJECT is a string, START and END are 0-based indices into it. */) | ||
| 1256 | (start, end, property, value, object) | 1273 | (start, end, property, value, object) |
| 1257 | Lisp_Object start, end, property, value, object; | 1274 | Lisp_Object start, end, property, value, object; |
| 1258 | { | 1275 | { |
| @@ -1266,9 +1283,9 @@ DEFUN ("set-text-properties", Fset_text_properties, | |||
| 1266 | Sset_text_properties, 3, 4, 0, | 1283 | Sset_text_properties, 3, 4, 0, |
| 1267 | doc: /* Completely replace properties of text from START to END. | 1284 | doc: /* Completely replace properties of text from START to END. |
| 1268 | The third argument PROPERTIES is the new property list. | 1285 | The third argument PROPERTIES is the new property list. |
| 1269 | The optional fourth argument, OBJECT, | 1286 | If the optional fourth argument OBJECT is a buffer (or nil, which means |
| 1270 | is the string or buffer containing the text. | 1287 | the current buffer), START and END are buffer positions (integers or |
| 1271 | If OBJECT is omitted or nil, it defaults to the current buffer. | 1288 | markers). If OBJECT is a string, START and END are 0-based indices into it. |
| 1272 | If PROPERTIES is nil, the effect is to remove all properties from | 1289 | If PROPERTIES is nil, the effect is to remove all properties from |
| 1273 | the designated part of OBJECT. */) | 1290 | the designated part of OBJECT. */) |
| 1274 | (start, end, properties, object) | 1291 | (start, end, properties, object) |
| @@ -1436,9 +1453,12 @@ DEFUN ("remove-text-properties", Fremove_text_properties, | |||
| 1436 | The third argument PROPERTIES is a property list | 1453 | The third argument PROPERTIES is a property list |
| 1437 | whose property names specify the properties to remove. | 1454 | whose property names specify the properties to remove. |
| 1438 | \(The values stored in PROPERTIES are ignored.) | 1455 | \(The values stored in PROPERTIES are ignored.) |
| 1439 | The optional fourth argument, OBJECT, | 1456 | If the optional fourth argument OBJECT is a buffer (or nil, which means |
| 1440 | is the string or buffer containing the text. | 1457 | the current buffer), START and END are buffer positions (integers or |
| 1441 | Return t if any property was actually removed, nil otherwise. */) | 1458 | markers). If OBJECT is a string, START and END are 0-based indices into it. |
| 1459 | Return t if any property was actually removed, nil otherwise. | ||
| 1460 | |||
| 1461 | Use set-text-properties if you want to remove all text properties. */) | ||
| 1442 | (start, end, properties, object) | 1462 | (start, end, properties, object) |
| 1443 | Lisp_Object start, end, properties, object; | 1463 | Lisp_Object start, end, properties, object; |
| 1444 | { | 1464 | { |
| @@ -1521,8 +1541,9 @@ DEFUN ("remove-list-of-text-properties", Fremove_list_of_text_properties, | |||
| 1521 | Sremove_list_of_text_properties, 3, 4, 0, | 1541 | Sremove_list_of_text_properties, 3, 4, 0, |
| 1522 | doc: /* Remove some properties from text from START to END. | 1542 | doc: /* Remove some properties from text from START to END. |
| 1523 | The third argument LIST-OF-PROPERTIES is a list of property names to remove. | 1543 | The third argument LIST-OF-PROPERTIES is a list of property names to remove. |
| 1524 | The optional fourth argument, OBJECT, | 1544 | If the optional fourth argument OBJECT is a buffer (or nil, which means |
| 1525 | is the string or buffer containing the text, defaulting to the current buffer. | 1545 | the current buffer), START and END are buffer positions (integers or |
| 1546 | markers). If OBJECT is a string, START and END are 0-based indices into it. | ||
| 1526 | Return t if any property was actually removed, nil otherwise. */) | 1547 | Return t if any property was actually removed, nil otherwise. */) |
| 1527 | (start, end, list_of_properties, object) | 1548 | (start, end, list_of_properties, object) |
| 1528 | Lisp_Object start, end, list_of_properties, object; | 1549 | Lisp_Object start, end, list_of_properties, object; |
| @@ -1609,8 +1630,9 @@ DEFUN ("text-property-any", Ftext_property_any, | |||
| 1609 | doc: /* Check text from START to END for property PROPERTY equalling VALUE. | 1630 | doc: /* Check text from START to END for property PROPERTY equalling VALUE. |
| 1610 | If so, return the position of the first character whose property PROPERTY | 1631 | If so, return the position of the first character whose property PROPERTY |
| 1611 | is `eq' to VALUE. Otherwise return nil. | 1632 | is `eq' to VALUE. Otherwise return nil. |
| 1612 | The optional fifth argument, OBJECT, is the string or buffer | 1633 | If the optional fifth argument OBJECT is a buffer (or nil, which means |
| 1613 | containing the text. */) | 1634 | the current buffer), START and END are buffer positions (integers or |
| 1635 | markers). If OBJECT is a string, START and END are 0-based indices into it. */) | ||
| 1614 | (start, end, property, value, object) | 1636 | (start, end, property, value, object) |
| 1615 | Lisp_Object start, end, property, value, object; | 1637 | Lisp_Object start, end, property, value, object; |
| 1616 | { | 1638 | { |
| @@ -1645,8 +1667,9 @@ DEFUN ("text-property-not-all", Ftext_property_not_all, | |||
| 1645 | doc: /* Check text from START to END for property PROPERTY not equalling VALUE. | 1667 | doc: /* Check text from START to END for property PROPERTY not equalling VALUE. |
| 1646 | If so, return the position of the first character whose property PROPERTY | 1668 | If so, return the position of the first character whose property PROPERTY |
| 1647 | is not `eq' to VALUE. Otherwise, return nil. | 1669 | is not `eq' to VALUE. Otherwise, return nil. |
| 1648 | The optional fifth argument, OBJECT, is the string or buffer | 1670 | If the optional fifth argument OBJECT is a buffer (or nil, which means |
| 1649 | containing the text. */) | 1671 | the current buffer), START and END are buffer positions (integers or |
| 1672 | markers). If OBJECT is a string, START and END are 0-based indices into it. */) | ||
| 1650 | (start, end, property, value, object) | 1673 | (start, end, property, value, object) |
| 1651 | Lisp_Object start, end, property, value, object; | 1674 | Lisp_Object start, end, property, value, object; |
| 1652 | { | 1675 | { |
| @@ -1850,23 +1873,23 @@ text_property_list (object, start, end, prop) | |||
| 1850 | Lisp_Object result; | 1873 | Lisp_Object result; |
| 1851 | 1874 | ||
| 1852 | result = Qnil; | 1875 | result = Qnil; |
| 1853 | 1876 | ||
| 1854 | i = validate_interval_range (object, &start, &end, soft); | 1877 | i = validate_interval_range (object, &start, &end, soft); |
| 1855 | if (!NULL_INTERVAL_P (i)) | 1878 | if (!NULL_INTERVAL_P (i)) |
| 1856 | { | 1879 | { |
| 1857 | int s = XINT (start); | 1880 | int s = XINT (start); |
| 1858 | int e = XINT (end); | 1881 | int e = XINT (end); |
| 1859 | 1882 | ||
| 1860 | while (s < e) | 1883 | while (s < e) |
| 1861 | { | 1884 | { |
| 1862 | int interval_end, len; | 1885 | int interval_end, len; |
| 1863 | Lisp_Object plist; | 1886 | Lisp_Object plist; |
| 1864 | 1887 | ||
| 1865 | interval_end = i->position + LENGTH (i); | 1888 | interval_end = i->position + LENGTH (i); |
| 1866 | if (interval_end > e) | 1889 | if (interval_end > e) |
| 1867 | interval_end = e; | 1890 | interval_end = e; |
| 1868 | len = interval_end - s; | 1891 | len = interval_end - s; |
| 1869 | 1892 | ||
| 1870 | plist = i->plist; | 1893 | plist = i->plist; |
| 1871 | 1894 | ||
| 1872 | if (!NILP (prop)) | 1895 | if (!NILP (prop)) |
| @@ -1882,14 +1905,14 @@ text_property_list (object, start, end, prop) | |||
| 1882 | Fcons (make_number (s + len), | 1905 | Fcons (make_number (s + len), |
| 1883 | Fcons (plist, Qnil))), | 1906 | Fcons (plist, Qnil))), |
| 1884 | result); | 1907 | result); |
| 1885 | 1908 | ||
| 1886 | i = next_interval (i); | 1909 | i = next_interval (i); |
| 1887 | if (NULL_INTERVAL_P (i)) | 1910 | if (NULL_INTERVAL_P (i)) |
| 1888 | break; | 1911 | break; |
| 1889 | s = i->position; | 1912 | s = i->position; |
| 1890 | } | 1913 | } |
| 1891 | } | 1914 | } |
| 1892 | 1915 | ||
| 1893 | return result; | 1916 | return result; |
| 1894 | } | 1917 | } |
| 1895 | 1918 | ||
| @@ -1906,18 +1929,18 @@ add_text_properties_from_list (object, list, delta) | |||
| 1906 | { | 1929 | { |
| 1907 | struct gcpro gcpro1, gcpro2; | 1930 | struct gcpro gcpro1, gcpro2; |
| 1908 | int modified_p = 0; | 1931 | int modified_p = 0; |
| 1909 | 1932 | ||
| 1910 | GCPRO2 (list, object); | 1933 | GCPRO2 (list, object); |
| 1911 | 1934 | ||
| 1912 | for (; CONSP (list); list = XCDR (list)) | 1935 | for (; CONSP (list); list = XCDR (list)) |
| 1913 | { | 1936 | { |
| 1914 | Lisp_Object item, start, end, plist, tem; | 1937 | Lisp_Object item, start, end, plist, tem; |
| 1915 | 1938 | ||
| 1916 | item = XCAR (list); | 1939 | item = XCAR (list); |
| 1917 | start = make_number (XINT (XCAR (item)) + XINT (delta)); | 1940 | start = make_number (XINT (XCAR (item)) + XINT (delta)); |
| 1918 | end = make_number (XINT (XCAR (XCDR (item))) + XINT (delta)); | 1941 | end = make_number (XINT (XCAR (XCDR (item))) + XINT (delta)); |
| 1919 | plist = XCAR (XCDR (XCDR (item))); | 1942 | plist = XCAR (XCDR (XCDR (item))); |
| 1920 | 1943 | ||
| 1921 | tem = Fadd_text_properties (start, end, plist, object); | 1944 | tem = Fadd_text_properties (start, end, plist, object); |
| 1922 | if (!NILP (tem)) | 1945 | if (!NILP (tem)) |
| 1923 | modified_p = 1; | 1946 | modified_p = 1; |
| @@ -1940,7 +1963,7 @@ extend_property_ranges (list, old_end, new_end) | |||
| 1940 | for (; CONSP (list); list = XCDR (list)) | 1963 | for (; CONSP (list); list = XCDR (list)) |
| 1941 | { | 1964 | { |
| 1942 | Lisp_Object item, end; | 1965 | Lisp_Object item, end; |
| 1943 | 1966 | ||
| 1944 | item = XCAR (list); | 1967 | item = XCAR (list); |
| 1945 | end = XCAR (XCDR (item)); | 1968 | end = XCAR (XCDR (item)); |
| 1946 | 1969 | ||
| @@ -2038,7 +2061,7 @@ verify_interval_modification (buf, start, end) | |||
| 2038 | if (! NULL_INTERVAL_P (i)) | 2061 | if (! NULL_INTERVAL_P (i)) |
| 2039 | { | 2062 | { |
| 2040 | after = textget (i->plist, Qread_only); | 2063 | after = textget (i->plist, Qread_only); |
| 2041 | 2064 | ||
| 2042 | /* If interval I is read-only and read-only is | 2065 | /* If interval I is read-only and read-only is |
| 2043 | front-sticky, inhibit insertion. | 2066 | front-sticky, inhibit insertion. |
| 2044 | Check for read-only as well as category. */ | 2067 | Check for read-only as well as category. */ |
| @@ -2058,7 +2081,7 @@ verify_interval_modification (buf, start, end) | |||
| 2058 | if (! NULL_INTERVAL_P (prev)) | 2081 | if (! NULL_INTERVAL_P (prev)) |
| 2059 | { | 2082 | { |
| 2060 | before = textget (prev->plist, Qread_only); | 2083 | before = textget (prev->plist, Qread_only); |
| 2061 | 2084 | ||
| 2062 | /* If interval PREV is read-only and read-only isn't | 2085 | /* If interval PREV is read-only and read-only isn't |
| 2063 | rear-nonsticky, inhibit insertion. | 2086 | rear-nonsticky, inhibit insertion. |
| 2064 | Check for read-only as well as category. */ | 2087 | Check for read-only as well as category. */ |
| @@ -2078,7 +2101,7 @@ verify_interval_modification (buf, start, end) | |||
| 2078 | else if (! NULL_INTERVAL_P (i)) | 2101 | else if (! NULL_INTERVAL_P (i)) |
| 2079 | { | 2102 | { |
| 2080 | after = textget (i->plist, Qread_only); | 2103 | after = textget (i->plist, Qread_only); |
| 2081 | 2104 | ||
| 2082 | /* If interval I is read-only and read-only is | 2105 | /* If interval I is read-only and read-only is |
| 2083 | front-sticky, inhibit insertion. | 2106 | front-sticky, inhibit insertion. |
| 2084 | Check for read-only as well as category. */ | 2107 | Check for read-only as well as category. */ |
| @@ -2206,7 +2229,7 @@ rear-nonsticky properties of the character overrides NONSTICKINESS. */); | |||
| 2206 | interval_insert_behind_hooks = Qnil; | 2229 | interval_insert_behind_hooks = Qnil; |
| 2207 | interval_insert_in_front_hooks = Qnil; | 2230 | interval_insert_in_front_hooks = Qnil; |
| 2208 | 2231 | ||
| 2209 | 2232 | ||
| 2210 | /* Common attributes one might give text */ | 2233 | /* Common attributes one might give text */ |
| 2211 | 2234 | ||
| 2212 | staticpro (&Qforeground); | 2235 | staticpro (&Qforeground); |
| @@ -2268,4 +2291,3 @@ rear-nonsticky properties of the character overrides NONSTICKINESS. */); | |||
| 2268 | /* defsubr (&Serase_text_properties); */ | 2291 | /* defsubr (&Serase_text_properties); */ |
| 2269 | /* defsubr (&Scopy_text_properties); */ | 2292 | /* defsubr (&Scopy_text_properties); */ |
| 2270 | } | 2293 | } |
| 2271 | |||