aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2005-08-20 21:48:51 +0000
committerRichard M. Stallman <[email protected]>2005-08-20 21:48:51 +0000
commit23bb94bb4a9edf0fede53274990c1e39f6dd6545 (patch)
tree79ba141a1b8f301a7732c4f24bbacd7ebb8a2bc9 /lisp/subr.el
parent3c24b4e4a5f36bf7c57d495332a73b7d00127bc6 (diff)
(replace-regexp-in-string): Doc fix.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index fba837212d..bc97a36721 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2167,9 +2167,10 @@ arguments with the same names of function `replace-match'. If START
is non-nil, start replacements at that index in STRING.
REP is either a string used as the NEWTEXT arg of `replace-match' or a
-function. If it is a function it is applied to each match to generate
-the replacement passed to `replace-match'; the match-data at this
-point are such that match 0 is the function's argument.
+function. If it is a function, it is called with the actual text of each
+match, and its value is used as the replacement text. When REP is called,
+the match-data are the result of matching REGEXP against a substring
+of STRING.
To replace only the first match (if any), make REGEXP match up to \\'
and replace a sub-expression, e.g.