From ff315081a1dd8aa3efc30d65f32f8af503059f86 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 6 May 2017 11:06:38 +0300 Subject: [PATCH] ; * lisp/replace.el (query-replace-regexp, replace-regexp): Doc fixes. --- lisp/replace.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/replace.el b/lisp/replace.el index a7b8ae6a347..477cc9c3055 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -405,8 +405,8 @@ replace backward. Fourth and fifth arg START and END specify the region to operate on. -In TO-STRING, `\\&' or `\\0' stands for whatever matched the whole of -REGEXP, and `\\=\\N' (where N is a digit) stands for whatever matched +In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP, +and `\\=\\N' (where N is a digit) stands for whatever matched the Nth `\\(...\\)' (1-based) in REGEXP. The `\\(...\\)' groups are counted from 1. `\\?' lets you edit the replacement text in the minibuffer @@ -652,9 +652,9 @@ replace backward. Fourth and fifth arg START and END specify the region to operate on. -In TO-STRING, `\\&' or `\\0' stands for whatever matched the whole of -REGEXP, and `\\=\\N' (where N is a digit) stands for -whatever matched the Nth `\\(...\\)' (1-based) in REGEXP. +In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP, +and `\\=\\N' (where N is a digit) stands for whatever matched +the Nth `\\(...\\)' (1-based) in REGEXP. `\\?' lets you edit the replacement text in the minibuffer at the given position for each replacement. @@ -663,7 +663,8 @@ followed by a Lisp expression used as part of the replacement text. Inside of that expression, `\\&' is a string denoting the whole match, `\\N' a partial match, `\\#&' and `\\#N' the respective numeric values from `string-to-number', and `\\#' itself for -`replace-count', the number of replacements occurred so far. +`replace-count', the number of replacements occurred so far, starting +from zero. If your Lisp expression is an identifier and the next letter in the replacement string would be interpreted as part of it, you -- 2.39.2