summaryrefslogtreecommitdiff
path: root/src/search.c
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2017-04-27 22:03:56 -0700
committerGlenn Morris <rgm@gnu.org>2017-04-27 22:03:56 -0700
commitcee4128135d0d9fd6032a0134b649d5fc81370c0 (patch)
treee62e97cbe32f4ca4f9540fe528dac0394702efdf /src/search.c
parentf0daad9adc5b8fd19f60f89e96b286a78f7162b3 (diff)
parent784602b10506c50075aa9463891a47380ebea55f (diff)
downloademacs-cee4128135d0d9fd6032a0134b649d5fc81370c0.tar.gz
emacs-cee4128135d0d9fd6032a0134b649d5fc81370c0.tar.bz2
emacs-cee4128135d0d9fd6032a0134b649d5fc81370c0.zip
Merge from origin/emacs-25
784602b1050 (origin/emacs-25) ; Add release notice 3a34412caae (tag: emacs-25.2) Set Emacs version to 25.2 and update AU... 56a4461a48d ; Move stray item from admin/notes/repo to CONTRIBUTE 2b0d1118199 ; CONTRIBUTE: Remove stray header. f2ab09ec60d Fix a typo in indexing the user manual bc55a574235 * lisp/menu-bar.el (kill-this-buffer): Doc fix. (Bug#26466) a6d50401b4b Document 'line-pixel-height' 0c55cf43e61 * search.c (Fre_search_forward, Fre_search_backward): Imp... c7ed57eaef4 Mention that processes start in default-directory (Bug#18... 856ec9ffa1f * src/xdisp.c (vmessage, message): Clarify commentary. 849a0aaa1c9 Belated fixes for admin.el's M-x make-manuals-dist 84938d79698 default-directory: Remark that it must be a directory name 3f0d047d2eb Delete confuse statement in manual ee1bd94dd0c Improve packaging documentation fb18bff91f0 Expand manual section on quitting windows 9a737079645 Fix docstring of dabbrev-abbrev-char-regexp afe8849bac1 * doc/misc/cl.texi (Iteration Clauses): Clarify example (... ada79442c07 ;* doc/misc/info.texi (Choose menu subtopic): Improve ind... d38fd9229c0 Narrow scope of modification hook renabling in org-src fo... e0e9db4c84a ; Spelling fix # Conflicts: # README # etc/AUTHORS # etc/HISTORY # lisp/ldefs-boot.el
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c52
1 files changed, 21 insertions, 31 deletions
diff --git a/src/search.c b/src/search.c
index c0deb57213c..f5f9e46d5a3 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2228,26 +2228,12 @@ See also the functions `match-beginning', `match-end' and `replace-match'. */)
DEFUN ("re-search-backward", Fre_search_backward, Sre_search_backward, 1, 4,
"sRE search backward: ",
- doc: /* Search backward from point for match for regular expression REGEXP.
-Set point to the beginning of the occurrence found, and return point.
-An optional second argument bounds the search; it is a buffer position.
- The match found must not begin before that position. A value of nil
- means search to the beginning of the accessible portion of the buffer.
-Optional third argument, if t, means if fail just return nil (no error).
- If not nil and not t, position at limit of search and return nil.
-Optional fourth argument COUNT, if a positive number, means to search
- for COUNT successive occurrences. If COUNT is negative, search
- forward, instead of backward, for -COUNT occurrences. A value of
- nil means the same as 1.
-With COUNT positive, the match found is the COUNTth to last one (or
- last, if COUNT is 1 or nil) in the buffer located entirely before
- the origin of the search; correspondingly with COUNT negative.
+ doc: /* Search backward from point for regular expression REGEXP.
+This function is almost identical to `re-search-forward', except that
+by default it searches backward instead of forward, and the sign of
+COUNT also indicates exactly the opposite searching direction.
-Search case-sensitivity is determined by the value of the variable
-`case-fold-search', which see.
-
-See also the functions `match-beginning', `match-end', `match-string',
-and `replace-match'. */)
+See `re-search-forward' for details. */)
(Lisp_Object regexp, Lisp_Object bound, Lisp_Object noerror, Lisp_Object count)
{
return search_command (regexp, bound, noerror, count, -1, 1, 0);
@@ -2257,18 +2243,22 @@ DEFUN ("re-search-forward", Fre_search_forward, Sre_search_forward, 1, 4,
"sRE search: ",
doc: /* Search forward from point for regular expression REGEXP.
Set point to the end of the occurrence found, and return point.
-An optional second argument bounds the search; it is a buffer position.
- The match found must not end after that position. A value of nil
- means search to the end of the accessible portion of the buffer.
-Optional third argument, if t, means if fail just return nil (no error).
- If not nil and not t, move to limit of search and return nil.
-Optional fourth argument COUNT, if a positive number, means to search
- for COUNT successive occurrences. If COUNT is negative, search
- backward, instead of forward, for -COUNT occurrences. A value of
- nil means the same as 1.
-With COUNT positive, the match found is the COUNTth one (or first,
- if COUNT is 1 or nil) in the buffer located entirely after the
- origin of the search; correspondingly with COUNT negative.
+The optional second argument BOUND is a buffer position that bounds
+ the search. The match found must not end after that position. A
+ value of nil means search to the end of the accessible portion of
+ the buffer.
+The optional third argument NOERROR indicates how errors are handled
+ when the search fails. If it is nil or omitted, emit an error; if
+ it is t, simply return nil and do nothing; if it is neither nil nor
+ t, move to the limit of search and return nil.
+The optional fourth argument COUNT is a number that indicates the
+ search direction and the number of occurrences to search for. If it
+ is positive, search forward for COUNT successive occurrences; if it
+ is negative, search backward, instead of forward, for -COUNT
+ occurrences. A value of nil means the same as 1.
+With COUNT positive/negative, the match found is the COUNTth/-COUNTth
+ one in the buffer located entirely after/before the origin of the
+ search.
Search case-sensitivity is determined by the value of the variable
`case-fold-search', which see.