diff options
Diffstat (limited to 'src/search.c')
| -rw-r--r-- | src/search.c | 85 |
1 files changed, 59 insertions, 26 deletions
diff --git a/src/search.c b/src/search.c index 7c4a02491db..3d4846644ee 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -2157,12 +2157,17 @@ DEFUN ("search-backward", Fsearch_backward, Ssearch_backward, 1, 4, | |||
| 2157 | doc: /* Search backward from point for STRING. | 2157 | doc: /* Search backward from point for STRING. |
| 2158 | Set point to the beginning of the occurrence found, and return point. | 2158 | Set point to the beginning of the occurrence found, and return point. |
| 2159 | An optional second argument bounds the search; it is a buffer position. | 2159 | An optional second argument bounds the search; it is a buffer position. |
| 2160 | The match found must not extend before that position. | 2160 | The match found must not begin before that position. A value of nil |
| 2161 | means search to the beginning of the accessible portion of the buffer. | ||
| 2161 | Optional third argument, if t, means if fail just return nil (no error). | 2162 | Optional third argument, if t, means if fail just return nil (no error). |
| 2162 | If not nil and not t, position at limit of search and return nil. | 2163 | If not nil and not t, position at limit of search and return nil. |
| 2163 | Optional fourth argument COUNT, if non-nil, means to search for COUNT | 2164 | Optional fourth argument COUNT, if a positive number, means to search |
| 2164 | successive occurrences. If COUNT is negative, search forward, | 2165 | for COUNT successive occurrences. If COUNT is negative, search |
| 2165 | instead of backward, for -COUNT occurrences. | 2166 | forward, instead of backward, for -COUNT occurrences. A value of |
| 2167 | nil means the same as 1. | ||
| 2168 | With COUNT positive, the match found is the COUNTth to last one (or | ||
| 2169 | last, if COUNT is 1 or nil) in the buffer located entirely before | ||
| 2170 | the origin of the search; correspondingly with COUNT negative. | ||
| 2166 | 2171 | ||
| 2167 | Search case-sensitivity is determined by the value of the variable | 2172 | Search case-sensitivity is determined by the value of the variable |
| 2168 | `case-fold-search', which see. | 2173 | `case-fold-search', which see. |
| @@ -2177,13 +2182,17 @@ DEFUN ("search-forward", Fsearch_forward, Ssearch_forward, 1, 4, "MSearch: ", | |||
| 2177 | doc: /* Search forward from point for STRING. | 2182 | doc: /* Search forward from point for STRING. |
| 2178 | Set point to the end of the occurrence found, and return point. | 2183 | Set point to the end of the occurrence found, and return point. |
| 2179 | An optional second argument bounds the search; it is a buffer position. | 2184 | An optional second argument bounds the search; it is a buffer position. |
| 2180 | The match found must not extend after that position. A value of nil is | 2185 | The match found must not end after that position. A value of nil |
| 2181 | equivalent to (point-max). | 2186 | means search to the end of the accessible portion of the buffer. |
| 2182 | Optional third argument, if t, means if fail just return nil (no error). | 2187 | Optional third argument, if t, means if fail just return nil (no error). |
| 2183 | If not nil and not t, move to limit of search and return nil. | 2188 | If not nil and not t, move to limit of search and return nil. |
| 2184 | Optional fourth argument COUNT, if non-nil, means to search for COUNT | 2189 | Optional fourth argument COUNT, if a positive number, means to search |
| 2185 | successive occurrences. If COUNT is negative, search backward, | 2190 | for COUNT successive occurrences. If COUNT is negative, search |
| 2186 | instead of forward, for -COUNT occurrences. | 2191 | backward, instead of forward, for -COUNT occurrences. A value of |
| 2192 | nil means the same as 1. | ||
| 2193 | With COUNT positive, the match found is the COUNTth one (or first, | ||
| 2194 | if COUNT is 1 or nil) in the buffer located entirely after the | ||
| 2195 | origin of the search; correspondingly with COUNT negative. | ||
| 2187 | 2196 | ||
| 2188 | Search case-sensitivity is determined by the value of the variable | 2197 | Search case-sensitivity is determined by the value of the variable |
| 2189 | `case-fold-search', which see. | 2198 | `case-fold-search', which see. |
| @@ -2197,14 +2206,19 @@ See also the functions `match-beginning', `match-end' and `replace-match'. */) | |||
| 2197 | DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4, | 2206 | DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4, |
| 2198 | "sRE search backward: ", | 2207 | "sRE search backward: ", |
| 2199 | doc: /* Search backward from point for match for regular expression REGEXP. | 2208 | doc: /* Search backward from point for match for regular expression REGEXP. |
| 2200 | Set point to the beginning of the match, and return point. | 2209 | Set point to the beginning of the occurrence found, and return point. |
| 2201 | The match found is the one starting last in the buffer | ||
| 2202 | and yet ending before the origin of the search. | ||
| 2203 | An optional second argument bounds the search; it is a buffer position. | 2210 | An optional second argument bounds the search; it is a buffer position. |
| 2204 | The match found must start at or after that position. | 2211 | The match found must not begin before that position. A value of nil |
| 2212 | means search to the beginning of the accessible portion of the buffer. | ||
| 2205 | Optional third argument, if t, means if fail just return nil (no error). | 2213 | Optional third argument, if t, means if fail just return nil (no error). |
| 2206 | If not nil and not t, move to limit of search and return nil. | 2214 | If not nil and not t, position at limit of search and return nil. |
| 2207 | Optional fourth argument is repeat count--search for successive occurrences. | 2215 | Optional fourth argument COUNT, if a positive number, means to search |
| 2216 | for COUNT successive occurrences. If COUNT is negative, search | ||
| 2217 | forward, instead of backward, for -COUNT occurrences. A value of | ||
| 2218 | nil means the same as 1. | ||
| 2219 | With COUNT positive, the match found is the COUNTth to last one (or | ||
| 2220 | last, if COUNT is 1 or nil) in the buffer located entirely before | ||
| 2221 | the origin of the search; correspondingly with COUNT negative. | ||
| 2208 | 2222 | ||
| 2209 | Search case-sensitivity is determined by the value of the variable | 2223 | Search case-sensitivity is determined by the value of the variable |
| 2210 | `case-fold-search', which see. | 2224 | `case-fold-search', which see. |
| @@ -2221,10 +2235,17 @@ DEFUN ("re-search-forward", Fre_search_forward, Sre_search_forward, 1, 4, | |||
| 2221 | doc: /* Search forward from point for regular expression REGEXP. | 2235 | doc: /* Search forward from point for regular expression REGEXP. |
| 2222 | Set point to the end of the occurrence found, and return point. | 2236 | Set point to the end of the occurrence found, and return point. |
| 2223 | An optional second argument bounds the search; it is a buffer position. | 2237 | An optional second argument bounds the search; it is a buffer position. |
| 2224 | The match found must not extend after that position. | 2238 | The match found must not end after that position. A value of nil |
| 2239 | means search to the end of the accessible portion of the buffer. | ||
| 2225 | Optional third argument, if t, means if fail just return nil (no error). | 2240 | Optional third argument, if t, means if fail just return nil (no error). |
| 2226 | If not nil and not t, move to limit of search and return nil. | 2241 | If not nil and not t, move to limit of search and return nil. |
| 2227 | Optional fourth argument is repeat count--search for successive occurrences. | 2242 | Optional fourth argument COUNT, if a positive number, means to search |
| 2243 | for COUNT successive occurrences. If COUNT is negative, search | ||
| 2244 | backward, instead of forward, for -COUNT occurrences. A value of | ||
| 2245 | nil means the same as 1. | ||
| 2246 | With COUNT positive, the match found is the COUNTth one (or first, | ||
| 2247 | if COUNT is 1 or nil) in the buffer located entirely after the | ||
| 2248 | origin of the search; correspondingly with COUNT negative. | ||
| 2228 | 2249 | ||
| 2229 | Search case-sensitivity is determined by the value of the variable | 2250 | Search case-sensitivity is determined by the value of the variable |
| 2230 | `case-fold-search', which see. | 2251 | `case-fold-search', which see. |
| @@ -2240,14 +2261,19 @@ DEFUN ("posix-search-backward", Fposix_search_backward, Sposix_search_backward, | |||
| 2240 | "sPosix search backward: ", | 2261 | "sPosix search backward: ", |
| 2241 | doc: /* Search backward from point for match for regular expression REGEXP. | 2262 | doc: /* Search backward from point for match for regular expression REGEXP. |
| 2242 | Find the longest match in accord with Posix regular expression rules. | 2263 | Find the longest match in accord with Posix regular expression rules. |
| 2243 | Set point to the beginning of the match, and return point. | 2264 | Set point to the beginning of the occurrence found, and return point. |
| 2244 | The match found is the one starting last in the buffer | ||
| 2245 | and yet ending before the origin of the search. | ||
| 2246 | An optional second argument bounds the search; it is a buffer position. | 2265 | An optional second argument bounds the search; it is a buffer position. |
| 2247 | The match found must start at or after that position. | 2266 | The match found must not begin before that position. A value of nil |
| 2267 | means search to the beginning of the accessible portion of the buffer. | ||
| 2248 | Optional third argument, if t, means if fail just return nil (no error). | 2268 | Optional third argument, if t, means if fail just return nil (no error). |
| 2249 | If not nil and not t, move to limit of search and return nil. | 2269 | If not nil and not t, position at limit of search and return nil. |
| 2250 | Optional fourth argument is repeat count--search for successive occurrences. | 2270 | Optional fourth argument COUNT, if a positive number, means to search |
| 2271 | for COUNT successive occurrences. If COUNT is negative, search | ||
| 2272 | forward, instead of backward, for -COUNT occurrences. A value of | ||
| 2273 | nil means the same as 1. | ||
| 2274 | With COUNT positive, the match found is the COUNTth to last one (or | ||
| 2275 | last, if COUNT is 1 or nil) in the buffer located entirely before | ||
| 2276 | the origin of the search; correspondingly with COUNT negative. | ||
| 2251 | 2277 | ||
| 2252 | Search case-sensitivity is determined by the value of the variable | 2278 | Search case-sensitivity is determined by the value of the variable |
| 2253 | `case-fold-search', which see. | 2279 | `case-fold-search', which see. |
| @@ -2265,10 +2291,17 @@ DEFUN ("posix-search-forward", Fposix_search_forward, Sposix_search_forward, 1, | |||
| 2265 | Find the longest match in accord with Posix regular expression rules. | 2291 | Find the longest match in accord with Posix regular expression rules. |
| 2266 | Set point to the end of the occurrence found, and return point. | 2292 | Set point to the end of the occurrence found, and return point. |
| 2267 | An optional second argument bounds the search; it is a buffer position. | 2293 | An optional second argument bounds the search; it is a buffer position. |
| 2268 | The match found must not extend after that position. | 2294 | The match found must not end after that position. A value of nil |
| 2295 | means search to the end of the accessible portion of the buffer. | ||
| 2269 | Optional third argument, if t, means if fail just return nil (no error). | 2296 | Optional third argument, if t, means if fail just return nil (no error). |
| 2270 | If not nil and not t, move to limit of search and return nil. | 2297 | If not nil and not t, move to limit of search and return nil. |
| 2271 | Optional fourth argument is repeat count--search for successive occurrences. | 2298 | Optional fourth argument COUNT, if a positive number, means to search |
| 2299 | for COUNT successive occurrences. If COUNT is negative, search | ||
| 2300 | backward, instead of forward, for -COUNT occurrences. A value of | ||
| 2301 | nil means the same as 1. | ||
| 2302 | With COUNT positive, the match found is the COUNTth one (or first, | ||
| 2303 | if COUNT is 1 or nil) in the buffer located entirely after the | ||
| 2304 | origin of the search; correspondingly with COUNT negative. | ||
| 2272 | 2305 | ||
| 2273 | Search case-sensitivity is determined by the value of the variable | 2306 | Search case-sensitivity is determined by the value of the variable |
| 2274 | `case-fold-search', which see. | 2307 | `case-fold-search', which see. |