aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorEli Zaretskii2016-07-02 18:03:09 +0300
committerEli Zaretskii2016-07-02 18:03:09 +0300
commit38f4b8ea615025e7996754fd72449be91c38d448 (patch)
treeed3d8dddcf974568ed6c5b5fd8cdc99485c93b99 /lisp/replace.el
parentd039fc4ff628ad7f983707609a6d04a96589895b (diff)
downloademacs-38f4b8ea615025e7996754fd72449be91c38d448.tar.gz
emacs-38f4b8ea615025e7996754fd72449be91c38d448.zip
Clarify the documentation of back-references in replacements
* doc/emacs/search.texi (Regexp Replace): Clarify that \D starts with \1, not \0. * lisp/replace.el (query-replace-regexp) (query-replace-regexp-eval, replace-regexp): Doc fix (Bug#23884)
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index fe90062cc8a..eb5e0cfffcb 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -391,9 +391,10 @@ replace backward.
391 391
392Fourth and fifth arg START and END specify the region to operate on. 392Fourth and fifth arg START and END specify the region to operate on.
393 393
394In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP, 394In TO-STRING, `\\&' or `\\0' stands for whatever matched the whole of
395and `\\=\\N' (where N is a digit) stands for 395REGEXP, and `\\=\\N' (where N is a digit) stands for whatever matched
396whatever what matched the Nth `\\(...\\)' in REGEXP. 396the Nth `\\(...\\)' (1-based) in REGEXP. The `\\(...\\)' groups are
397counted from 1.
397`\\?' lets you edit the replacement text in the minibuffer 398`\\?' lets you edit the replacement text in the minibuffer
398at the given position for each replacement. 399at the given position for each replacement.
399 400
@@ -451,7 +452,9 @@ If the result of TO-EXPR is not a string, it is converted to one using
451 452
452For convenience, when entering TO-EXPR interactively, you can use `\\&' or 453For convenience, when entering TO-EXPR interactively, you can use `\\&' or
453`\\0' to stand for whatever matched the whole of REGEXP, and `\\N' (where 454`\\0' to stand for whatever matched the whole of REGEXP, and `\\N' (where
454N is a digit) to stand for whatever matched the Nth `\\(...\\)' in REGEXP. 455N is a digit) to stand for whatever matched the Nth `\\(...\\)' (1-based)
456in REGEXP.
457
455Use `\\#&' or `\\#N' if you want a number instead of a string. 458Use `\\#&' or `\\#N' if you want a number instead of a string.
456In interactive use, `\\#' in itself stands for `replace-count'. 459In interactive use, `\\#' in itself stands for `replace-count'.
457 460
@@ -635,9 +638,9 @@ replace backward.
635 638
636Fourth and fifth arg START and END specify the region to operate on. 639Fourth and fifth arg START and END specify the region to operate on.
637 640
638In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP, 641In TO-STRING, `\\&' or `\\0' stands for whatever matched the whole of
639and `\\=\\N' (where N is a digit) stands for 642REGEXP, and `\\=\\N' (where N is a digit) stands for
640whatever what matched the Nth `\\(...\\)' in REGEXP. 643whatever matched the Nth `\\(...\\)' (1-based) in REGEXP.
641`\\?' lets you edit the replacement text in the minibuffer 644`\\?' lets you edit the replacement text in the minibuffer
642at the given position for each replacement. 645at the given position for each replacement.
643 646