summaryrefslogtreecommitdiff
path: root/doc/emacs/maintaining.texi
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2022-10-10 11:05:18 +0300
committerEli Zaretskii <eliz@gnu.org>2022-10-10 11:05:18 +0300
commite016e60a0452bc26f562780f43c2bcd4aab21bdc (patch)
treed4e79c5742d65eb180d28f56a1b79a9dbdcf3772 /doc/emacs/maintaining.texi
parentf91ae9479000eb3c91eaed2a1300678466b823d4 (diff)
downloademacs-e016e60a0452bc26f562780f43c2bcd4aab21bdc.tar.gz
emacs-e016e60a0452bc26f562780f43c2bcd4aab21bdc.tar.bz2
emacs-e016e60a0452bc26f562780f43c2bcd4aab21bdc.zip
; Clarify correct use of 'xref-query-replace-in-results'
* lisp/progmodes/xref.el (xref--query-replace-1): Improve the user-error message. (xref-query-replace-in-results): Clarify restrictions in the doc string. * doc/emacs/maintaining.texi (Xref Commands, Identifier Search): Clarify the correct usage of 'xref-query-replace-in-results'.
Diffstat (limited to 'doc/emacs/maintaining.texi')
-rw-r--r--doc/emacs/maintaining.texi19
1 files changed, 12 insertions, 7 deletions
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 6857e67def9..671d4dd4225 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -2302,7 +2302,9 @@ Display the reference on the current line in the other window
@item r @var{pattern} @key{RET} @var{replacement} @key{RET}
Perform interactive query-replace on references that match
@var{pattern} (@code{xref-query-replace-in-results}), replacing
-the match with @var{replacement}. @xref{Identifier Search}.
+the match with @var{replacement}. This command can only be used in
+@file{*xref*} buffers that show all the matches for an identifier in
+all the relevant files. @xref{Identifier Search}.
@item g
@findex xref-revert-buffer
@@ -2336,7 +2338,8 @@ them.
@item M-?
Find all the references for the identifier at point.
-@item M-x xref-query-replace-in-results @key{RET} @var{replacement} @key{RET}
+@item r@r{, Xref command}
+@itemx M-x xref-query-replace-in-results @key{RET} @var{replacement} @key{RET}
@itemx C-u M-x xref-query-replace-in-results @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET}
Interactively replace @var{regexp} with @var{replacement} in the names
of all the identifiers shown in the @file{*xref*} buffer.
@@ -2382,16 +2385,18 @@ shown. The default value is @code{nil}, which just shows the results
in the @file{*xref*} buffer, but doesn't select any of them.
@findex xref-query-replace-in-results
- @kbd{M-x xref-query-replace-in-results} reads a @var{replacement}
+ @kbd{r} (@code{xref-query-replace-in-results}) reads a @var{replacement}
string, just like ordinary @kbd{M-x query-replace-regexp}. It then
renames the identifiers shown in the @file{*xref*} buffer in all the
places in all the files where these identifiers are referenced, such
that their new name is @var{replacement}. This is useful when you
rename your identifiers as part of refactoring. This command should
-be invoked in the @file{*xref*} buffer generated by @kbd{M-?}. With a
-prefix argument, the command also prompts for a regexp to match
-identifier names, and renames that regexp in the names of the matching
-identifiers with @var{replacement}.
+be invoked in the @file{*xref*} buffer generated by @kbd{M-?}. By
+default, the command replaces the entire name of each identifier with
+@var{replacement}, but if invoked with a prefix argument, the command
+prompts for a regexp to match identifier names, and replaces only the
+matches of that regexp in the names of the identifiers with
+@var{replacement}.
@findex xref-find-references-and-replace
@kbd{M-x xref-find-references-and-replace} works similarly to