aboutsummaryrefslogtreecommitdiffstats
path: root/src/search.c
diff options
context:
space:
mode:
authorPaul Eggert2016-08-05 14:09:08 -0700
committerPaul Eggert2016-08-05 14:09:08 -0700
commit6b780a2e97c032d1749f190e0f5cfbbce99d0a60 (patch)
tree18287633d9eb2d63d8badf035144e8a3143c00db /src/search.c
parent95c6606a477e017ed7b418fcc81fd937895fee20 (diff)
parent9ba51edf62b25c678508a316ec78a09b18d3bf9e (diff)
downloademacs-6b780a2e97c032d1749f190e0f5cfbbce99d0a60.tar.gz
emacs-6b780a2e97c032d1749f190e0f5cfbbce99d0a60.zip
Merge from origin/emacs-25
9ba51ed Document buffer-swap-text+save-excursion interaction 452aa94 Fix eieio vs cl-generic incompatibilities found in Rudel (bug... 248d5dd Include cl-generic in package--builtin-versions (bug#22817) 8f5a8b6 Improve timing in `tramp-test29-environment-variables' 05ba7a0 Add test for handling environment variables in Tramp e393d4f * lisp/emacs-lisp/package.el (describe-package-1) (package-st... 5e38887 ; * lisp/net/tramp.el: Fix 2010-10-04 comment typo. (Bug#23913) 90f2169 ; Spelling fixes 069fc05 Improve documentation of search functions 0a0144a Delete environment variables in Tramp when needed f624671 Add "New in Emacs 25" section to the FAQ 658daf9 Fix 'vertical-motion' in non-interactive sessions 686b520 Fix memory leak in imagemagick-types 4069b71 Update ELisp manual to match 'string-collate-equalp' doc string 1b2d6a6 Clarify docstring of find-feature-regexp aac62a6 Add details to cl-lib defining macros' docstrings d6aa4da Clarify doc string of 'save-buffer' 03bcf11 Un-confuse doc string of 'string-collate-equalp' c53135b Clarify documentation of 'mouse-on-link-p' # Conflicts: # lisp/emacs-lisp/eieio-core.el
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c85
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.
2158Set point to the beginning of the occurrence found, and return point. 2158Set point to the beginning of the occurrence found, and return point.
2159An optional second argument bounds the search; it is a buffer position. 2159An optional second argument bounds the search; it is a buffer position.
2160The 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.
2161Optional third argument, if t, means if fail just return nil (no error). 2162Optional 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.
2163Optional fourth argument COUNT, if non-nil, means to search for COUNT 2164Optional 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.
2168With 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
2167Search case-sensitivity is determined by the value of the variable 2172Search 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.
2178Set point to the end of the occurrence found, and return point. 2183Set point to the end of the occurrence found, and return point.
2179An optional second argument bounds the search; it is a buffer position. 2184An optional second argument bounds the search; it is a buffer position.
2180The 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.
2182Optional third argument, if t, means if fail just return nil (no error). 2187Optional 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.
2184Optional fourth argument COUNT, if non-nil, means to search for COUNT 2189Optional 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.
2193With 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
2188Search case-sensitivity is determined by the value of the variable 2197Search 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'. */)
2197DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4, 2206DEFUN ("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.
2200Set point to the beginning of the match, and return point. 2209Set point to the beginning of the occurrence found, and return point.
2201The match found is the one starting last in the buffer
2202and yet ending before the origin of the search.
2203An optional second argument bounds the search; it is a buffer position. 2210An optional second argument bounds the search; it is a buffer position.
2204The 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.
2205Optional third argument, if t, means if fail just return nil (no error). 2213Optional 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.
2207Optional fourth argument is repeat count--search for successive occurrences. 2215Optional 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.
2219With 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
2209Search case-sensitivity is determined by the value of the variable 2223Search 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.
2222Set point to the end of the occurrence found, and return point. 2236Set point to the end of the occurrence found, and return point.
2223An optional second argument bounds the search; it is a buffer position. 2237An optional second argument bounds the search; it is a buffer position.
2224The 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.
2225Optional third argument, if t, means if fail just return nil (no error). 2240Optional 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.
2227Optional fourth argument is repeat count--search for successive occurrences. 2242Optional 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.
2246With 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
2229Search case-sensitivity is determined by the value of the variable 2250Search 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.
2242Find the longest match in accord with Posix regular expression rules. 2263Find the longest match in accord with Posix regular expression rules.
2243Set point to the beginning of the match, and return point. 2264Set point to the beginning of the occurrence found, and return point.
2244The match found is the one starting last in the buffer
2245and yet ending before the origin of the search.
2246An optional second argument bounds the search; it is a buffer position. 2265An optional second argument bounds the search; it is a buffer position.
2247The 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.
2248Optional third argument, if t, means if fail just return nil (no error). 2268Optional 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.
2250Optional fourth argument is repeat count--search for successive occurrences. 2270Optional 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.
2274With 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
2252Search case-sensitivity is determined by the value of the variable 2278Search 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,
2265Find the longest match in accord with Posix regular expression rules. 2291Find the longest match in accord with Posix regular expression rules.
2266Set point to the end of the occurrence found, and return point. 2292Set point to the end of the occurrence found, and return point.
2267An optional second argument bounds the search; it is a buffer position. 2293An optional second argument bounds the search; it is a buffer position.
2268The 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.
2269Optional third argument, if t, means if fail just return nil (no error). 2296Optional 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.
2271Optional fourth argument is repeat count--search for successive occurrences. 2298Optional 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.
2302With 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
2273Search case-sensitivity is determined by the value of the variable 2306Search case-sensitivity is determined by the value of the variable
2274`case-fold-search', which see. 2307`case-fold-search', which see.