diff options
| -rw-r--r-- | src/textprop.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/textprop.c b/src/textprop.c index 960dba3f8dc..0876badc873 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -766,14 +766,13 @@ 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. | 766 | If OBJECT is a string, POSITION is a 0-based index into it. |
| 767 | 767 | ||
| 768 | In a string, scan runs to the end of the string, unless LIMIT is non-nil. | 768 | In a string, scan runs to the end of the string, unless LIMIT is non-nil. |
| 769 | In a buffer, if LIMIT is nil or omitted, it runs to (point-max), and the | 769 | In a buffer, scan runs to end of buffer, unless LIMIT is non-nil. |
| 770 | value cannot exceed that. | ||
| 771 | If the optional fourth argument LIMIT is non-nil, don't search | 770 | If the optional fourth argument LIMIT is non-nil, don't search |
| 772 | past position LIMIT; return LIMIT if nothing is found before LIMIT. | 771 | past position LIMIT; return LIMIT if nothing is found before LIMIT. |
| 772 | However, if OBJECT is a buffer and LIMIT is beyond the end of the | ||
| 773 | buffer, this function returns `point-max', not LIMIT. | ||
| 773 | 774 | ||
| 774 | The property values are compared with `eq'. | 775 | The property values are compared with `eq'. */) |
| 775 | If the property is constant all the way to the end of OBJECT, return the | ||
| 776 | last valid position in OBJECT. */) | ||
| 777 | (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit) | 776 | (Lisp_Object position, Lisp_Object prop, Lisp_Object object, Lisp_Object limit) |
| 778 | { | 777 | { |
| 779 | if (STRINGP (object)) | 778 | if (STRINGP (object)) |
| @@ -832,6 +831,9 @@ last valid position in OBJECT. */) | |||
| 832 | value = Fget_char_property (position, prop, object); | 831 | value = Fget_char_property (position, prop, object); |
| 833 | if (!EQ (value, initial_value)) | 832 | if (!EQ (value, initial_value)) |
| 834 | break; | 833 | break; |
| 834 | |||
| 835 | if (XFIXNAT (position) >= ZV) | ||
| 836 | break; | ||
| 835 | } | 837 | } |
| 836 | 838 | ||
| 837 | position = unbind_to (count, position); | 839 | position = unbind_to (count, position); |