(Search and Replace): Document `replace-search-function' and

`replace-re-search-function'.
This commit is contained in:
Eli Zaretskii 2008-10-18 14:07:36 +00:00
parent 6d4913f0d3
commit 80120f13ef
3 changed files with 35 additions and 4 deletions

View file

@ -1,5 +1,8 @@
2008-10-18 Eli Zaretskii <eliz@gnu.org>
* searching.texi (Search and Replace): Document
`replace-search-function' and `replace-re-search-function'.
* minibuf.texi (Text from Minibuffer): Document `read-regexp'.
(Completion Commands, Reading File Names): Rename
`minibuffer-local-must-match-filename-map' to

View file

@ -1625,8 +1625,8 @@ The argument @var{replacements} specifies what to replace occurrences
with. If it is a string, that string is used. It can also be a list of
strings, to be used in cyclic order.
If @var{replacements} is a cons cell, @code{(@var{function}
. @var{data})}, this means to call @var{function} after each match to
If @var{replacements} is a cons cell, @w{@code{(@var{function}
. @var{data})}}, this means to call @var{function} after each match to
get the replacement text. This function is called with two arguments:
@var{data}, and the number of replacements already made.
@ -1642,6 +1642,13 @@ Normally, the keymap @code{query-replace-map} defines the possible
user responses for queries. The argument @var{map}, if
non-@code{nil}, specifies a keymap to use instead of
@code{query-replace-map}.
This function uses one of two functions to search for the next
occurrence of @var{from-string}. These functions are specified by the
values of two variables: @code{replace-re-search-function} and
@code{replace-search-function}. The former is called when the
argument @var{regexp-flag} is non-@code{nil}, the latter when it is
@code{nil}.
@end defun
@defvar query-replace-map
@ -1712,6 +1719,22 @@ use this answer.
Display some help, then ask again.
@end table
@defvar replace-search-function
This variable specifies a function that @code{perform-replace} calls
to search for the next string to replace. Its default value is
@code{search-forward}. Any other value should name a function of 3
arguments: the first 3 arguments of @code{search-forward}
(@pxref{String Search}).
@end defvar
@defvar replace-re-search-function
This variable specifies a function that @code{perform-replace} calls
to search for the next regexp to replace. Its default value is
@code{re-search-forward}. Any other value should name a function of 3
arguments: the first 3 arguments of @code{re-search-forward}
(@pxref{Regexp Search}).
@end defvar
@node Standard Regexps
@section Standard Regular Expressions Used in Editing
@cindex regexps used standardly in editing

View file

@ -1272,13 +1272,18 @@ completion-all-completions-with-base-size.
*** New function `match-substitute-replacement' returns the result of
`replace-match' without actually using it in the buffer.
+++
*** The new variable `replace-search-function' determines the function
to use for searching in query-replace and replace-string.
to use for searching in query-replace and replace-string. The
function it specifies is called by `perform-replace' when its 4th
argument is nil.
+++
*** The new variable `replace-re-search-function' determines the
function to use for searching in `query-replace-regexp',
`replace-regexp', `query-replace-regexp-eval', and
`map-query-replace-regexp'.
`map-query-replace-regexp'. The function it specifies is called by
`perform-replace' when its 4th argument is non-nil.
*** New keymap `search-map' bound to `M-s' provides global bindings
for search related commands.