diff options
author | Stephen Berman <stephen.berman@gmx.net> | 2016-07-12 22:11:22 +0200 |
---|---|---|
committer | Stephen Berman <stephen.berman@gmx.net> | 2016-07-12 22:11:22 +0200 |
commit | 069fc05bd5fabdd5971e2c5230a8586248fb7f38 (patch) | |
tree | d5481fa5874fa9c2a789e62cafefb72d4bef253d /lisp | |
parent | 0a0144a2e15a00b5c3272ad95e62d1d489b453c4 (diff) |
Improve documentation of search functions
Make the documentation of the search functions more accurate,
complete, and uniform; in particular, extend the description of
the effect when the 'count' parameter is a negative number to all
of these functions.
* src/search.c (Fsearch_backward, Fsearch_forward)
(Fre_search_backward, Fre_search_forward)
(Fposix_search_backward, Fposix_search_forward):
* lisp/isearch.el (word-search-backward, word-search-forward)
(word-search-backward-lax, word-search-forward-lax): Improve doc
strings as described above.
* doc/lispref/searching.texi (String Search, Regexp Search)
(POSIX Regexps): Use 'count' instead of 'repeat' as the name of
the fourth parameter of the *-search-{forward,backward} functions
and improve documentation as described above.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/isearch.el | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index 7360a0b374..a97247671c 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1624,10 +1624,17 @@ Used in `word-search-forward', `word-search-backward', "Search backward from point for STRING, ignoring differences in punctuation. 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 extend before that 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, move to limit of search and return nil. -Optional fourth argument is repeat count--search for successive occurrences. + 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. Relies on the function `word-search-regexp' to convert a sequence of words in STRING to a regexp used to search words without regard @@ -1641,10 +1648,17 @@ has no effect on it." "Search forward from point for STRING, ignoring differences in punctuation. 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 extend after that 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 is repeat count--search for successive occurrences. +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. Relies on the function `word-search-regexp' to convert a sequence of words in STRING to a regexp used to search words without regard @@ -1662,10 +1676,17 @@ Unlike `word-search-backward', the end of STRING need not match a word boundary, unless STRING ends in whitespace. An optional second argument bounds the search; it is a buffer position. -The match found must not extend before that 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, move to limit of search and return nil. -Optional fourth argument is repeat count--search for successive occurrences. + 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. Relies on the function `word-search-regexp' to convert a sequence of words in STRING to a regexp used to search words without regard @@ -1683,10 +1704,17 @@ Unlike `word-search-forward', the end of STRING need not match a word boundary, unless STRING ends in whitespace. An optional second argument bounds the search; it is a buffer position. -The match found must not extend after that 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 is repeat count--search for successive occurrences. +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. Relies on the function `word-search-regexp' to convert a sequence of words in STRING to a regexp used to search words without regard |