aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHong Xu2016-12-12 19:20:31 -0800
committerNoam Postavsky2017-04-06 19:12:33 -0400
commit0c55cf43e61537364ee7ea3d6ba77bb6ac3ef8a3 (patch)
tree4a48cc79262bf1ebd7a0271b90bddc71e50a9dd8
parentc7ed57eaef46ed74ce926fc05dec9eaa5737f3d9 (diff)
downloademacs-0c55cf43e61537364ee7ea3d6ba77bb6ac3ef8a3.tar.gz
emacs-0c55cf43e61537364ee7ea3d6ba77bb6ac3ef8a3.zip
* search.c (Fre_search_forward, Fre_search_backward): Improve doc (Bug#25193).
-rw-r--r--src/search.c52
1 files changed, 21 insertions, 31 deletions
diff --git a/src/search.c b/src/search.c
index ec3c3bf03cc..0793f9a8fb7 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2257,26 +2257,12 @@ See also the functions `match-beginning', `match-end' and `replace-match'. */)
2257 2257
2258DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4, 2258DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4,
2259 "sRE search backward: ", 2259 "sRE search backward: ",
2260 doc: /* Search backward from point for match for regular expression REGEXP. 2260 doc: /* Search backward from point for regular expression REGEXP.
2261Set point to the beginning of the occurrence found, and return point. 2261This function is almost identical to `re-search-forward', except that
2262An optional second argument bounds the search; it is a buffer position. 2262by default it searches backward instead of forward, and the sign of
2263 The match found must not begin before that position. A value of nil 2263COUNT also indicates exactly the opposite searching direction.
2264 means search to the beginning of the accessible portion of the buffer.
2265Optional third argument, if t, means if fail just return nil (no error).
2266 If not nil and not t, position at limit of search and return nil.
2267Optional fourth argument COUNT, if a positive number, means to search
2268 for COUNT successive occurrences. If COUNT is negative, search
2269 forward, instead of backward, for -COUNT occurrences. A value of
2270 nil means the same as 1.
2271With COUNT positive, the match found is the COUNTth to last one (or
2272 last, if COUNT is 1 or nil) in the buffer located entirely before
2273 the origin of the search; correspondingly with COUNT negative.
2274 2264
2275Search case-sensitivity is determined by the value of the variable 2265See `re-search-forward' for details. */)
2276`case-fold-search', which see.
2277
2278See also the functions `match-beginning', `match-end', `match-string',
2279and `replace-match'. */)
2280 (Lisp_Object regexp, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count) 2266 (Lisp_Object regexp, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
2281{ 2267{
2282 return search_command (regexp, bound, noerror, count, -1, 1, 0); 2268 return search_command (regexp, bound, noerror, count, -1, 1, 0);
@@ -2286,18 +2272,22 @@ DEFUN ("re-search-forward", Fre_search_forward, Sre_search_forward, 1, 4,
2286 "sRE search: ", 2272 "sRE search: ",
2287 doc: /* Search forward from point for regular expression REGEXP. 2273 doc: /* Search forward from point for regular expression REGEXP.
2288Set point to the end of the occurrence found, and return point. 2274Set point to the end of the occurrence found, and return point.
2289An optional second argument bounds the search; it is a buffer position. 2275The optional second argument BOUND is a buffer position that bounds
2290 The match found must not end after that position. A value of nil 2276 the search. The match found must not end after that position. A
2291 means search to the end of the accessible portion of the buffer. 2277 value of nil means search to the end of the accessible portion of
2292Optional third argument, if t, means if fail just return nil (no error). 2278 the buffer.
2293 If not nil and not t, move to limit of search and return nil. 2279The optional third argument NOERROR indicates how errors are handled
2294Optional fourth argument COUNT, if a positive number, means to search 2280 when the search fails. If it is nil or omitted, emit an error; if
2295 for COUNT successive occurrences. If COUNT is negative, search 2281 it is t, simply return nil and do nothing; if it is neither nil nor
2296 backward, instead of forward, for -COUNT occurrences. A value of 2282 t, move to the limit of search and return nil.
2297 nil means the same as 1. 2283The optional fourth argument COUNT is a number that indicates the
2298With COUNT positive, the match found is the COUNTth one (or first, 2284 search direction and the number of occurrences to search for. If it
2299 if COUNT is 1 or nil) in the buffer located entirely after the 2285 is positive, search forward for COUNT successive occurrences; if it
2300 origin of the search; correspondingly with COUNT negative. 2286 is negative, search backward, instead of forward, for -COUNT
2287 occurrences. A value of nil means the same as 1.
2288With COUNT positive/negative, the match found is the COUNTth/-COUNTth
2289 one in the buffer located entirely after/before the origin of the
2290 search.
2301 2291
2302Search case-sensitivity is determined by the value of the variable 2292Search case-sensitivity is determined by the value of the variable
2303`case-fold-search', which see. 2293`case-fold-search', which see.