aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2015-04-24 11:24:56 +0300
committerEli Zaretskii2015-04-24 11:24:56 +0300
commit168609cc1b7b10d71e08b3166233026b1f0c8794 (patch)
treec244be9e4030033ca1910183eae4af23b73ef249 /src
parenta3ac56ca550509ddcf8ab3bf23bbe939336caccc (diff)
downloademacs-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.c60
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,
711This scans characters forward in the current buffer from POSITION till 711This scans characters forward in the current buffer from POSITION till
712it finds a change in some text property, or the beginning or end of an 712it finds a change in some text property, or the beginning or end of an
713overlay, and returns the position of that. 713overlay, and returns the position of that.
714If none is found up to (point-max), the function returns (point-max). 714If none is found, and LIMIT is nil or omitted, the function
715returns (point-max).
715 716
716If the optional second argument LIMIT is non-nil, don't search 717If the optional second argument LIMIT is non-nil, the function doesn't
717past position LIMIT; return LIMIT if nothing is found before LIMIT. 718search past position LIMIT, and returns LIMIT if nothing is found
718LIMIT is a no-op if it is greater than (point-max). */) 719before 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,
736Scans characters backward in the current buffer from POSITION till it 737Scans characters backward in the current buffer from POSITION till it
737finds a change in some text property, or the beginning or end of an 738finds a change in some text property, or the beginning or end of an
738overlay, and returns the position of that. 739overlay, and returns the position of that.
739If none is found since (point-min), the function returns (point-min). 740If none is found, and LIMIT is nil or imitted, the function
741returns (point-min).
740 742
741If the optional second argument LIMIT is non-nil, don't search 743If the optional second argument LIMIT is non-nil, the function doesn't
742past position LIMIT; return LIMIT if nothing is found before LIMIT. 744search before position LIMIT, and returns LIMIT if nothing is found
743LIMIT is a no-op if it is less than (point-min). */) 745before 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
765the current buffer), POSITION is a buffer position (integer or marker). 767the current buffer), POSITION is a buffer position (integer or marker).
766If OBJECT is a string, POSITION is a 0-based index into it. 768If OBJECT is a string, POSITION is a 0-based index into it.
767 769
768In a string, scan runs to the end of the string. 770In a string, scan runs to the end of the string, unless LIMIT is non-nil.
769In a buffer, it runs to (point-max), and the value cannot exceed that. 771In a buffer, if LIMIT is nil or omitted, it runs to (point-max), and the
772value cannot exceed that.
773If the optional fourth argument LIMIT is non-nil, don't search
774past position LIMIT; return LIMIT if nothing is found before LIMIT.
770 775
771The property values are compared with `eq'. 776The property values are compared with `eq'.
772If the property is constant all the way to the end of OBJECT, return the 777If the property is constant all the way to the end of OBJECT, return the
773last valid position in OBJECT. 778last valid position in OBJECT. */)
774If the optional fourth argument LIMIT is non-nil, don't search
775past 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
849the current buffer), POSITION is a buffer position (integer or marker). 852the current buffer), POSITION is a buffer position (integer or marker).
850If OBJECT is a string, POSITION is a 0-based index into it. 853If OBJECT is a string, POSITION is a 0-based index into it.
851 854
852In a string, scan runs to the start of the string. 855In a string, scan runs to the start of the string, unless LIMIT is non-nil.
853In a buffer, it runs to (point-min), and the value cannot be less than that. 856In a buffer, if LIMIT is nil or omitted, it runs to (point-min), and the
857value cannot be less than that.
858If the optional fourth argument LIMIT is non-nil, don't search back past
859position LIMIT; return LIMIT if nothing is found before reaching LIMIT.
854 860
855The property values are compared with `eq'. 861The property values are compared with `eq'.
856If the property is constant all the way to the start of OBJECT, return the 862If the property is constant all the way to the start of OBJECT, return the
857first valid position in OBJECT. 863first valid position in OBJECT. */)
858If the optional fourth argument LIMIT is non-nil, don't search back past
859position 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.
940If the optional second argument OBJECT is a buffer (or nil, which means 944If the optional second argument OBJECT is a buffer (or nil, which means
941the current buffer), POSITION is a buffer position (integer or marker). 945the current buffer), POSITION is a buffer position (integer or marker).
942If OBJECT is a string, POSITION is a 0-based index into it. 946If OBJECT is a string, POSITION is a 0-based index into it.
943Return nil if the property is constant all the way to the end of OBJECT. 947Return nil if LIMIT is nil or omitted, and the property is constant all
944If the value is non-nil, it is a position greater than POSITION, never equal. 948the way to the end of OBJECT; if the value is non-nil, it is a position
949greater than POSITION, never equal.
945 950
946If the optional third argument LIMIT is non-nil, don't search 951If the optional third argument LIMIT is non-nil, don't search
947past position LIMIT; return LIMIT if nothing is found before LIMIT. */) 952past 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
1005the current buffer), POSITION is a buffer position (integer or marker). 1010the current buffer), POSITION is a buffer position (integer or marker).
1006If OBJECT is a string, POSITION is a 0-based index into it. 1011If OBJECT is a string, POSITION is a 0-based index into it.
1007The property values are compared with `eq'. 1012The property values are compared with `eq'.
1008Return nil if the property is constant all the way to the end of OBJECT. 1013Return nil if LIMIT is nil or omitted, and the property is constant all
1009If the value is non-nil, it is a position greater than POSITION, never equal. 1014the way to the end of OBJECT; if the value is non-nil, it is a position
1015greater than POSITION, never equal.
1010 1016
1011If the optional fourth argument LIMIT is non-nil, don't search 1017If the optional fourth argument LIMIT is non-nil, don't search
1012past position LIMIT; return LIMIT if nothing is found before LIMIT. */) 1018past 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.
1052If the optional second argument OBJECT is a buffer (or nil, which means 1058If the optional second argument OBJECT is a buffer (or nil, which means
1053the current buffer), POSITION is a buffer position (integer or marker). 1059the current buffer), POSITION is a buffer position (integer or marker).
1054If OBJECT is a string, POSITION is a 0-based index into it. 1060If OBJECT is a string, POSITION is a 0-based index into it.
1055Return nil if the property is constant all the way to the start of OBJECT. 1061Return nil if LIMIT is nil or omitted, and the property is constant all
1056If the value is non-nil, it is a position less than POSITION, never equal. 1062the way to the start of OBJECT; if the value is non-nil, it is a position
1063less than POSITION, never equal.
1057 1064
1058If the optional third argument LIMIT is non-nil, don't search 1065If the optional third argument LIMIT is non-nil, don't search
1059back past position LIMIT; return LIMIT if nothing is found until LIMIT. */) 1066back 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
1100the current buffer), POSITION is a buffer position (integer or marker). 1107the current buffer), POSITION is a buffer position (integer or marker).
1101If OBJECT is a string, POSITION is a 0-based index into it. 1108If OBJECT is a string, POSITION is a 0-based index into it.
1102The property values are compared with `eq'. 1109The property values are compared with `eq'.
1103Return nil if the property is constant all the way to the start of OBJECT. 1110Return nil if LIMIT is nil or omitted, and the property is constant all
1104If the value is non-nil, it is a position less than POSITION, never equal. 1111the way to the start of OBJECT; if the value is non-nil, it is a position
1112less than POSITION, never equal.
1105 1113
1106If the optional fourth argument LIMIT is non-nil, don't search 1114If the optional fourth argument LIMIT is non-nil, don't search
1107back past position LIMIT; return LIMIT if nothing is found until LIMIT. */) 1115back past position LIMIT; return LIMIT if nothing is found until LIMIT. */)