diff options
| author | Eli Zaretskii | 2015-04-24 11:24:56 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2015-04-24 11:24:56 +0300 |
| commit | 168609cc1b7b10d71e08b3166233026b1f0c8794 (patch) | |
| tree | c244be9e4030033ca1910183eae4af23b73ef249 /src | |
| parent | a3ac56ca550509ddcf8ab3bf23bbe939336caccc (diff) | |
| download | emacs-168609cc1b7b10d71e08b3166233026b1f0c8794.tar.gz emacs-168609cc1b7b10d71e08b3166233026b1f0c8794.zip | |
Clarify doc strings of functions that search for properties
* src/textprop.c (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): Clarify doc strings wrt return
value and the optional LIMIT argument. (Bug#20411)
Diffstat (limited to 'src')
| -rw-r--r-- | src/textprop.c | 60 |
1 files changed, 34 insertions, 26 deletions
diff --git a/src/textprop.c b/src/textprop.c index 108c226a432..f50ef08a223 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -711,11 +711,12 @@ DEFUN ("next-char-property-change", Fnext_char_property_change, | |||
| 711 | This scans characters forward in the current buffer from POSITION till | 711 | This scans characters forward in the current buffer from POSITION till |
| 712 | it finds a change in some text property, or the beginning or end of an | 712 | it finds a change in some text property, or the beginning or end of an |
| 713 | overlay, and returns the position of that. | 713 | overlay, and returns the position of that. |
| 714 | If none is found up to (point-max), the function returns (point-max). | 714 | If none is found, and LIMIT is nil or omitted, the function |
| 715 | returns (point-max). | ||
| 715 | 716 | ||
| 716 | If the optional second argument LIMIT is non-nil, don't search | 717 | If the optional second argument LIMIT is non-nil, the function doesn't |
| 717 | past position LIMIT; return LIMIT if nothing is found before LIMIT. | 718 | search past position LIMIT, and returns LIMIT if nothing is found |
| 718 | LIMIT is a no-op if it is greater than (point-max). */) | 719 | before LIMIT. LIMIT is a no-op if it is greater than (point-max). */) |
| 719 | (Lisp_Object position, Lisp_Object limit) | 720 | (Lisp_Object position, Lisp_Object limit) |
| 720 | { | 721 | { |
| 721 | Lisp_Object temp; | 722 | Lisp_Object temp; |
| @@ -736,11 +737,12 @@ DEFUN ("previous-char-property-change", Fprevious_char_property_change, | |||
| 736 | Scans characters backward in the current buffer from POSITION till it | 737 | Scans characters backward in the current buffer from POSITION till it |
| 737 | finds a change in some text property, or the beginning or end of an | 738 | finds a change in some text property, or the beginning or end of an |
| 738 | overlay, and returns the position of that. | 739 | overlay, and returns the position of that. |
| 739 | If none is found since (point-min), the function returns (point-min). | 740 | If none is found, and LIMIT is nil or imitted, the function |
| 741 | returns (point-min). | ||
| 740 | 742 | ||
| 741 | If the optional second argument LIMIT is non-nil, don't search | 743 | If the optional second argument LIMIT is non-nil, the function doesn't |
| 742 | past position LIMIT; return LIMIT if nothing is found before LIMIT. | 744 | search before position LIMIT, and returns LIMIT if nothing is found |
| 743 | LIMIT is a no-op if it is less than (point-min). */) | 745 | before LIMIT. LIMIT is a no-op if it is less than (point-min). */) |
| 744 | (Lisp_Object position, Lisp_Object limit) | 746 | (Lisp_Object position, Lisp_Object limit) |
| 745 | { | 747 | { |
| 746 | Lisp_Object temp; | 748 | Lisp_Object temp; |
| @@ -765,14 +767,15 @@ If the optional third argument OBJECT is a buffer (or nil, which means | |||
| 765 | the current buffer), POSITION is a buffer position (integer or marker). | 767 | the current buffer), POSITION is a buffer position (integer or marker). |
| 766 | If OBJECT is a string, POSITION is a 0-based index into it. | 768 | If OBJECT is a string, POSITION is a 0-based index into it. |
| 767 | 769 | ||
| 768 | In a string, scan runs to the end of the string. | 770 | In a string, scan runs to the end of the string, unless LIMIT is non-nil. |
| 769 | In a buffer, it runs to (point-max), and the value cannot exceed that. | 771 | In a buffer, if LIMIT is nil or omitted, it runs to (point-max), and the |
| 772 | value cannot exceed that. | ||
| 773 | If the optional fourth argument LIMIT is non-nil, don't search | ||
| 774 | past position LIMIT; return LIMIT if nothing is found before LIMIT. | ||
| 770 | 775 | ||
| 771 | The property values are compared with `eq'. | 776 | The property values are compared with `eq'. |
| 772 | If the property is constant all the way to the end of OBJECT, return the | 777 | If the property is constant all the way to the end of OBJECT, return the |
| 773 | last valid position in OBJECT. | 778 | last valid position in OBJECT. */) |
| 774 | If the optional fourth argument LIMIT is non-nil, don't search | ||
| 775 | past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | ||
| 776 | (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit) | 779 | (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit) |
| 777 | { | 780 | { |
| 778 | if (STRINGP (object)) | 781 | if (STRINGP (object)) |
| @@ -849,14 +852,15 @@ If the optional third argument OBJECT is a buffer (or nil, which means | |||
| 849 | the current buffer), POSITION is a buffer position (integer or marker). | 852 | the current buffer), POSITION is a buffer position (integer or marker). |
| 850 | If OBJECT is a string, POSITION is a 0-based index into it. | 853 | If OBJECT is a string, POSITION is a 0-based index into it. |
| 851 | 854 | ||
| 852 | In a string, scan runs to the start of the string. | 855 | In a string, scan runs to the start of the string, unless LIMIT is non-nil. |
| 853 | In a buffer, it runs to (point-min), and the value cannot be less than that. | 856 | In a buffer, if LIMIT is nil or omitted, it runs to (point-min), and the |
| 857 | value cannot be less than that. | ||
| 858 | If the optional fourth argument LIMIT is non-nil, don't search back past | ||
| 859 | position LIMIT; return LIMIT if nothing is found before reaching LIMIT. | ||
| 854 | 860 | ||
| 855 | The property values are compared with `eq'. | 861 | The property values are compared with `eq'. |
| 856 | If the property is constant all the way to the start of OBJECT, return the | 862 | If the property is constant all the way to the start of OBJECT, return the |
| 857 | first valid position in OBJECT. | 863 | first valid position in OBJECT. */) |
| 858 | If the optional fourth argument LIMIT is non-nil, don't search back past | ||
| 859 | position LIMIT; return LIMIT if nothing is found before reaching LIMIT. */) | ||
| 860 | (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit) | 864 | (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit) |
| 861 | { | 865 | { |
| 862 | if (STRINGP (object)) | 866 | if (STRINGP (object)) |
| @@ -940,8 +944,9 @@ a change in some text property, then returns the position of the change. | |||
| 940 | If the optional second argument OBJECT is a buffer (or nil, which means | 944 | If the optional second argument OBJECT is a buffer (or nil, which means |
| 941 | the current buffer), POSITION is a buffer position (integer or marker). | 945 | the current buffer), POSITION is a buffer position (integer or marker). |
| 942 | If OBJECT is a string, POSITION is a 0-based index into it. | 946 | If OBJECT is a string, POSITION is a 0-based index into it. |
| 943 | Return nil if the property is constant all the way to the end of OBJECT. | 947 | Return nil if LIMIT is nil or omitted, and the property is constant all |
| 944 | If the value is non-nil, it is a position greater than POSITION, never equal. | 948 | the way to the end of OBJECT; if the value is non-nil, it is a position |
| 949 | greater than POSITION, never equal. | ||
| 945 | 950 | ||
| 946 | If the optional third argument LIMIT is non-nil, don't search | 951 | If the optional third argument LIMIT is non-nil, don't search |
| 947 | past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | 952 | past position LIMIT; return LIMIT if nothing is found before LIMIT. */) |
| @@ -1005,8 +1010,9 @@ If the optional third argument OBJECT is a buffer (or nil, which means | |||
| 1005 | the current buffer), POSITION is a buffer position (integer or marker). | 1010 | the current buffer), POSITION is a buffer position (integer or marker). |
| 1006 | If OBJECT is a string, POSITION is a 0-based index into it. | 1011 | If OBJECT is a string, POSITION is a 0-based index into it. |
| 1007 | The property values are compared with `eq'. | 1012 | The property values are compared with `eq'. |
| 1008 | Return nil if the property is constant all the way to the end of OBJECT. | 1013 | Return nil if LIMIT is nil or omitted, and the property is constant all |
| 1009 | If the value is non-nil, it is a position greater than POSITION, never equal. | 1014 | the way to the end of OBJECT; if the value is non-nil, it is a position |
| 1015 | greater than POSITION, never equal. | ||
| 1010 | 1016 | ||
| 1011 | If the optional fourth argument LIMIT is non-nil, don't search | 1017 | If the optional fourth argument LIMIT is non-nil, don't search |
| 1012 | past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | 1018 | past position LIMIT; return LIMIT if nothing is found before LIMIT. */) |
| @@ -1052,8 +1058,9 @@ a change in some text property, then returns the position of the change. | |||
| 1052 | If the optional second argument OBJECT is a buffer (or nil, which means | 1058 | If the optional second argument OBJECT is a buffer (or nil, which means |
| 1053 | the current buffer), POSITION is a buffer position (integer or marker). | 1059 | the current buffer), POSITION is a buffer position (integer or marker). |
| 1054 | If OBJECT is a string, POSITION is a 0-based index into it. | 1060 | If OBJECT is a string, POSITION is a 0-based index into it. |
| 1055 | Return nil if the property is constant all the way to the start of OBJECT. | 1061 | Return nil if LIMIT is nil or omitted, and the property is constant all |
| 1056 | If the value is non-nil, it is a position less than POSITION, never equal. | 1062 | the way to the start of OBJECT; if the value is non-nil, it is a position |
| 1063 | less than POSITION, never equal. | ||
| 1057 | 1064 | ||
| 1058 | If the optional third argument LIMIT is non-nil, don't search | 1065 | If the optional third argument LIMIT is non-nil, don't search |
| 1059 | back past position LIMIT; return LIMIT if nothing is found until LIMIT. */) | 1066 | back past position LIMIT; return LIMIT if nothing is found until LIMIT. */) |
| @@ -1100,8 +1107,9 @@ If the optional third argument OBJECT is a buffer (or nil, which means | |||
| 1100 | the current buffer), POSITION is a buffer position (integer or marker). | 1107 | the current buffer), POSITION is a buffer position (integer or marker). |
| 1101 | If OBJECT is a string, POSITION is a 0-based index into it. | 1108 | If OBJECT is a string, POSITION is a 0-based index into it. |
| 1102 | The property values are compared with `eq'. | 1109 | The property values are compared with `eq'. |
| 1103 | Return nil if the property is constant all the way to the start of OBJECT. | 1110 | Return nil if LIMIT is nil or omitted, and the property is constant all |
| 1104 | If the value is non-nil, it is a position less than POSITION, never equal. | 1111 | the way to the start of OBJECT; if the value is non-nil, it is a position |
| 1112 | less than POSITION, never equal. | ||
| 1105 | 1113 | ||
| 1106 | If the optional fourth argument LIMIT is non-nil, don't search | 1114 | If the optional fourth argument LIMIT is non-nil, don't search |
| 1107 | back past position LIMIT; return LIMIT if nothing is found until LIMIT. */) | 1115 | back past position LIMIT; return LIMIT if nothing is found until LIMIT. */) |