aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2008-10-18 14:07:36 +0000
committerEli Zaretskii2008-10-18 14:07:36 +0000
commit80120f13ef629d16601efcc9afdad274ff63339a (patch)
tree188ae46386b68f871521523ca57070e738244efb
parent6d4913f0d38434ae3998ef0e2a791eccba135e98 (diff)
downloademacs-80120f13ef629d16601efcc9afdad274ff63339a.tar.gz
emacs-80120f13ef629d16601efcc9afdad274ff63339a.zip
(Search and Replace): Document `replace-search-function' and
`replace-re-search-function'.
-rw-r--r--doc/lispref/ChangeLog3
-rw-r--r--doc/lispref/searching.texi27
-rw-r--r--etc/NEWS9
3 files changed, 35 insertions, 4 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 7e1ba05893b..9dd3a77636a 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,5 +1,8 @@
12008-10-18 Eli Zaretskii <eliz@gnu.org> 12008-10-18 Eli Zaretskii <eliz@gnu.org>
2 2
3 * searching.texi (Search and Replace): Document
4 `replace-search-function' and `replace-re-search-function'.
5
3 * minibuf.texi (Text from Minibuffer): Document `read-regexp'. 6 * minibuf.texi (Text from Minibuffer): Document `read-regexp'.
4 (Completion Commands, Reading File Names): Rename 7 (Completion Commands, Reading File Names): Rename
5 `minibuffer-local-must-match-filename-map' to 8 `minibuffer-local-must-match-filename-map' to
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 9b54aa18b08..6bca6c79f27 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -1625,8 +1625,8 @@ The argument @var{replacements} specifies what to replace occurrences
1625with. If it is a string, that string is used. It can also be a list of 1625with. If it is a string, that string is used. It can also be a list of
1626strings, to be used in cyclic order. 1626strings, to be used in cyclic order.
1627 1627
1628If @var{replacements} is a cons cell, @code{(@var{function} 1628If @var{replacements} is a cons cell, @w{@code{(@var{function}
1629. @var{data})}, this means to call @var{function} after each match to 1629. @var{data})}}, this means to call @var{function} after each match to
1630get the replacement text. This function is called with two arguments: 1630get the replacement text. This function is called with two arguments:
1631@var{data}, and the number of replacements already made. 1631@var{data}, and the number of replacements already made.
1632 1632
@@ -1642,6 +1642,13 @@ Normally, the keymap @code{query-replace-map} defines the possible
1642user responses for queries. The argument @var{map}, if 1642user responses for queries. The argument @var{map}, if
1643non-@code{nil}, specifies a keymap to use instead of 1643non-@code{nil}, specifies a keymap to use instead of
1644@code{query-replace-map}. 1644@code{query-replace-map}.
1645
1646This function uses one of two functions to search for the next
1647occurrence of @var{from-string}. These functions are specified by the
1648values of two variables: @code{replace-re-search-function} and
1649@code{replace-search-function}. The former is called when the
1650argument @var{regexp-flag} is non-@code{nil}, the latter when it is
1651@code{nil}.
1645@end defun 1652@end defun
1646 1653
1647@defvar query-replace-map 1654@defvar query-replace-map
@@ -1712,6 +1719,22 @@ use this answer.
1712Display some help, then ask again. 1719Display some help, then ask again.
1713@end table 1720@end table
1714 1721
1722@defvar replace-search-function
1723This variable specifies a function that @code{perform-replace} calls
1724to search for the next string to replace. Its default value is
1725@code{search-forward}. Any other value should name a function of 3
1726arguments: the first 3 arguments of @code{search-forward}
1727(@pxref{String Search}).
1728@end defvar
1729
1730@defvar replace-re-search-function
1731This variable specifies a function that @code{perform-replace} calls
1732to search for the next regexp to replace. Its default value is
1733@code{re-search-forward}. Any other value should name a function of 3
1734arguments: the first 3 arguments of @code{re-search-forward}
1735(@pxref{Regexp Search}).
1736@end defvar
1737
1715@node Standard Regexps 1738@node Standard Regexps
1716@section Standard Regular Expressions Used in Editing 1739@section Standard Regular Expressions Used in Editing
1717@cindex regexps used standardly in editing 1740@cindex regexps used standardly in editing
diff --git a/etc/NEWS b/etc/NEWS
index 48e430f902b..de994736a2c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1272,13 +1272,18 @@ completion-all-completions-with-base-size.
1272*** New function `match-substitute-replacement' returns the result of 1272*** New function `match-substitute-replacement' returns the result of
1273`replace-match' without actually using it in the buffer. 1273`replace-match' without actually using it in the buffer.
1274 1274
1275+++
1275*** The new variable `replace-search-function' determines the function 1276*** The new variable `replace-search-function' determines the function
1276to use for searching in query-replace and replace-string. 1277to use for searching in query-replace and replace-string. The
1278function it specifies is called by `perform-replace' when its 4th
1279argument is nil.
1277 1280
1281+++
1278*** The new variable `replace-re-search-function' determines the 1282*** The new variable `replace-re-search-function' determines the
1279function to use for searching in `query-replace-regexp', 1283function to use for searching in `query-replace-regexp',
1280`replace-regexp', `query-replace-regexp-eval', and 1284`replace-regexp', `query-replace-regexp-eval', and
1281`map-query-replace-regexp'. 1285`map-query-replace-regexp'. The function it specifies is called by
1286`perform-replace' when its 4th argument is non-nil.
1282 1287
1283*** New keymap `search-map' bound to `M-s' provides global bindings 1288*** New keymap `search-map' bound to `M-s' provides global bindings
1284for search related commands. 1289for search related commands.