mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-15 17:00:26 +00:00
Rename xref-query-replace to xref-query-replace-in-results
* lisp/progmodes/xref.el(xref-query-replace): Rename to xref-query-replace-in-results. (http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg01240.html) * lisp/progmodes/xref.el (xref--xref-buffer-mode-map): * lisp/dired-aux.el (dired-do-find-regexp-and-replace): * doc/emacs/dired.texi (Operating on Files): * doc/emacs/maintaining.texi (Xref Commands) (Identifier Search, Identifier Search): Update accordingly.
This commit is contained in:
parent
62f4ed477e
commit
3f481ad007
@ -797,8 +797,8 @@ Perform @code{query-replace-regexp} on each of the specified files,
|
||||
replacing matches for @var{regexp} with the string
|
||||
@var{to} (@code{dired-do-find-regexp-and-replace}).
|
||||
|
||||
This command is a variant of @code{xref-query-replace}. It presents
|
||||
an @file{*xref*} buffer that lists all the matches of @var{regexp},
|
||||
This command is a variant of @code{xref-query-replace-in-results}. It
|
||||
presents an @file{*xref*} buffer that lists all the matches of @var{regexp},
|
||||
and you can use the special commands in that buffer (@pxref{Xref
|
||||
Commands}). In particular, if you exit the query replace loop, you
|
||||
can use @kbd{r} in that buffer to replace more matches.
|
||||
|
@ -1875,11 +1875,11 @@ Move to the previous reference and display it in the other window
|
||||
@findex xref-show-location-at-point
|
||||
Display the reference on the current line in the other window
|
||||
(@code{xref-show-location-at-point}).
|
||||
@findex xref-query-replace
|
||||
@findex xref-query-replace-in-results
|
||||
@item r @var{pattern} @key{RET} @var{replacement} @key{RET}
|
||||
Perform interactive query-replace on references that match
|
||||
@var{pattern} (@code{xref-query-replace}), replacing the match with
|
||||
@var{replacement}. @xref{Identifier Search}.
|
||||
@var{pattern} (@code{xref-query-replace-in-results}), replacing
|
||||
the match with @var{replacement}. @xref{Identifier Search}.
|
||||
@findex xref-quit
|
||||
@item q
|
||||
Quit the window showing the @file{*xref*} buffer (@code{xref-quit}).
|
||||
@ -1901,7 +1901,7 @@ them.
|
||||
@table @kbd
|
||||
@item M-?
|
||||
Find all the references for the identifier at point.
|
||||
@item M-x xref-query-replace @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET}
|
||||
@item 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.
|
||||
@item M-x tags-search @key{RET} @var{regexp} @key{RET}
|
||||
@ -1923,8 +1923,8 @@ identifier, showing the file name and the line where the identifier is
|
||||
referenced. The XREF mode commands are available in this buffer, see
|
||||
@ref{Xref Commands}.
|
||||
|
||||
@findex xref-query-replace
|
||||
@kbd{M-x xref-query-replace} reads a regexp to match identifier
|
||||
@findex xref-query-replace-in-results
|
||||
@kbd{M-x xref-query-replace-in-results} reads a regexp to match identifier
|
||||
names and a replacement string, just like ordinary @kbd{M-x
|
||||
query-replace-regexp}. It then performs the specified replacement in
|
||||
the names of the matching identifiers in all the places in all the
|
||||
|
4
etc/NEWS
4
etc/NEWS
@ -1162,8 +1162,8 @@ compression command is determined from the new
|
||||
+++
|
||||
*** New user interface for the `A' and `Q' commands.
|
||||
These keys, now bound to `dired-do-find-regexp' and
|
||||
`dired-do-find-regexp-and-replace', work similarly to
|
||||
`xref-find-apropos' and `xref-query-replace': they present the matches
|
||||
`dired-do-find-regexp-and-replace', work similarly to `xref-find-apropos'
|
||||
and `xref-query-replace-in-results': they present the matches
|
||||
in the `*xref*' buffer and let you move through the matches. No need
|
||||
to use `tags-loop-continue' to resume the search or replace loop. The
|
||||
previous commands, `dired-do-search' and
|
||||
|
@ -2714,7 +2714,7 @@ with the command \\[tags-loop-continue]."
|
||||
'(dired-get-marked-files nil nil 'dired-nondirectory-p)))
|
||||
|
||||
(declare-function xref--show-xrefs "xref")
|
||||
(declare-function xref-query-replace "xref")
|
||||
(declare-function xref-query-replace-in-results "xref")
|
||||
|
||||
;;;###autoload
|
||||
(defun dired-do-find-regexp (regexp)
|
||||
@ -2746,7 +2746,7 @@ with the command \\[tags-loop-continue]."
|
||||
"Query replace regexp in marked files" t t)))
|
||||
(list (nth 0 common) (nth 1 common))))
|
||||
(with-current-buffer (dired-do-find-regexp from)
|
||||
(xref-query-replace from to)))
|
||||
(xref-query-replace-in-results from to)))
|
||||
|
||||
(defun dired-nondirectory-p (file)
|
||||
(not (file-directory-p file)))
|
||||
|
@ -502,7 +502,7 @@ WINDOW controls how the buffer is displayed:
|
||||
(xref-quit)
|
||||
(xref--pop-to-location xref window)))
|
||||
|
||||
(defun xref-query-replace (from to)
|
||||
(defun xref-query-replace-in-results (from to)
|
||||
"Perform interactive replacement of FROM with TO in all displayed xrefs.
|
||||
|
||||
This command interactively replaces FROM with TO in the names of the
|
||||
@ -589,7 +589,7 @@ references displayed in the current *xref* buffer."
|
||||
(define-key map [remap quit-window] #'xref-quit)
|
||||
(define-key map (kbd "n") #'xref-next-line)
|
||||
(define-key map (kbd "p") #'xref-prev-line)
|
||||
(define-key map (kbd "r") #'xref-query-replace)
|
||||
(define-key map (kbd "r") #'xref-query-replace-in-results)
|
||||
(define-key map (kbd "RET") #'xref-goto-xref)
|
||||
(define-key map (kbd "C-o") #'xref-show-location-at-point)
|
||||
;; suggested by Johan Claesson "to further reduce finger movement":
|
||||
|
Loading…
Reference in New Issue
Block a user