diff options
| author | Eli Zaretskii | 2008-10-18 14:07:36 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2008-10-18 14:07:36 +0000 |
| commit | 80120f13ef629d16601efcc9afdad274ff63339a (patch) | |
| tree | 188ae46386b68f871521523ca57070e738244efb | |
| parent | 6d4913f0d38434ae3998ef0e2a791eccba135e98 (diff) | |
| download | emacs-80120f13ef629d16601efcc9afdad274ff63339a.tar.gz emacs-80120f13ef629d16601efcc9afdad274ff63339a.zip | |
(Search and Replace): Document `replace-search-function' and
`replace-re-search-function'.
| -rw-r--r-- | doc/lispref/ChangeLog | 3 | ||||
| -rw-r--r-- | doc/lispref/searching.texi | 27 | ||||
| -rw-r--r-- | etc/NEWS | 9 |
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 @@ | |||
| 1 | 2008-10-18 Eli Zaretskii <eliz@gnu.org> | 1 | 2008-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 | |||
| 1625 | with. If it is a string, that string is used. It can also be a list of | 1625 | with. If it is a string, that string is used. It can also be a list of |
| 1626 | strings, to be used in cyclic order. | 1626 | strings, to be used in cyclic order. |
| 1627 | 1627 | ||
| 1628 | If @var{replacements} is a cons cell, @code{(@var{function} | 1628 | If @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 |
| 1630 | get the replacement text. This function is called with two arguments: | 1630 | get 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 | |||
| 1642 | user responses for queries. The argument @var{map}, if | 1642 | user responses for queries. The argument @var{map}, if |
| 1643 | non-@code{nil}, specifies a keymap to use instead of | 1643 | non-@code{nil}, specifies a keymap to use instead of |
| 1644 | @code{query-replace-map}. | 1644 | @code{query-replace-map}. |
| 1645 | |||
| 1646 | This function uses one of two functions to search for the next | ||
| 1647 | occurrence of @var{from-string}. These functions are specified by the | ||
| 1648 | values of two variables: @code{replace-re-search-function} and | ||
| 1649 | @code{replace-search-function}. The former is called when the | ||
| 1650 | argument @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. | |||
| 1712 | Display some help, then ask again. | 1719 | Display some help, then ask again. |
| 1713 | @end table | 1720 | @end table |
| 1714 | 1721 | ||
| 1722 | @defvar replace-search-function | ||
| 1723 | This variable specifies a function that @code{perform-replace} calls | ||
| 1724 | to search for the next string to replace. Its default value is | ||
| 1725 | @code{search-forward}. Any other value should name a function of 3 | ||
| 1726 | arguments: the first 3 arguments of @code{search-forward} | ||
| 1727 | (@pxref{String Search}). | ||
| 1728 | @end defvar | ||
| 1729 | |||
| 1730 | @defvar replace-re-search-function | ||
| 1731 | This variable specifies a function that @code{perform-replace} calls | ||
| 1732 | to 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 | ||
| 1734 | arguments: 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 |
| @@ -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 |
| 1276 | to use for searching in query-replace and replace-string. | 1277 | to use for searching in query-replace and replace-string. The |
| 1278 | function it specifies is called by `perform-replace' when its 4th | ||
| 1279 | argument 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 |
| 1279 | function to use for searching in `query-replace-regexp', | 1283 | function 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 |
| 1284 | for search related commands. | 1289 | for search related commands. |