Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
80120f13
Commit
80120f13
authored
Oct 18, 2008
by
Eli Zaretskii
Browse files
(Search and Replace): Document `replace-search-function' and
`replace-re-search-function'.
parent
6d4913f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
4 deletions
+35
-4
doc/lispref/ChangeLog
doc/lispref/ChangeLog
+3
-0
doc/lispref/searching.texi
doc/lispref/searching.texi
+25
-2
etc/NEWS
etc/NEWS
+7
-2
No files found.
doc/lispref/ChangeLog
View file @
80120f13
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
...
...
doc/lispref/searching.texi
View file @
80120f13
...
...
@@ -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
...
...
etc/NEWS
View file @
80120f13
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment