diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2019-06-26 11:23:32 +0200 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2019-06-26 19:39:32 +0200 |
commit | cda2f52b94a5a94566c668835f1c4964f4d93b2b (patch) | |
tree | b14ec0bc321d84c13a7a0c7fc32f6bdc312e9a5a /doc | |
parent | 85871ae9ceb7a87c49f735b2b3c5b4e017e25139 (diff) | |
download | emacs-cda2f52b94a5a94566c668835f1c4964f4d93b2b.tar.gz |
Document bug in `replace-regexp-in-string'
`replace-regexp-in-string' omits the first START characters of the
input string in its return value. This is a clear bug, but fixing it
probably causes more trouble; document the behaviour instead (bug#36372).
* doc/lispref/searching.texi (Search and Replace)
* lisp/subr.el (replace-regexp-in-string):
Document current behaviour.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lispref/searching.texi | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 33455114dac..ef1cffc446f 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1790,8 +1790,10 @@ this. This function copies @var{string} and searches it for matches for @var{regexp}, and replaces them with @var{rep}. It returns the modified copy. If @var{start} is non-@code{nil}, the search for -matches starts at that index in @var{string}, so matches starting -before that index are not changed. +matches starts at that index in @var{string}, and the returned value +does not include the first @var{start} characters of @var{string}. +To get the whole transformed string, concatenate the first +@var{start} characters of @var{string} with the return value. This function uses @code{replace-match} to do the replacement, and it passes the optional arguments @var{fixedcase}, @var{literal} and |