mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-31 20:02:42 +00:00
Improve doc strings and prompts in xref.el
* lisp/progmodes/xref.el (xref-backend-functions) (xref-find-definitions): Doc fixes. (xref-query-replace): Doc fix. Improve prompts for arguments.
This commit is contained in:
parent
f6117ef754
commit
db3c2a8daa
@ -208,7 +208,7 @@ LENGTH is the match length, in characters."
|
|||||||
|
|
||||||
(defvar xref-backend-functions nil
|
(defvar xref-backend-functions nil
|
||||||
"Special hook to find the xref backend for the current context.
|
"Special hook to find the xref backend for the current context.
|
||||||
Each functions on this hook is called in turn with no arguments
|
Each function on this hook is called in turn with no arguments,
|
||||||
and should return either nil to mean that it is not applicable,
|
and should return either nil to mean that it is not applicable,
|
||||||
or an xref backend, which is a value to be used to dispatch the
|
or an xref backend, which is a value to be used to dispatch the
|
||||||
generic functions.")
|
generic functions.")
|
||||||
@ -502,10 +502,14 @@ WINDOW controls how the buffer is displayed:
|
|||||||
(xref--pop-to-location xref window)))
|
(xref--pop-to-location xref window)))
|
||||||
|
|
||||||
(defun xref-query-replace (from to)
|
(defun xref-query-replace (from to)
|
||||||
"Perform interactive replacement in all current matches."
|
"Perform interactive replacement of FROM with TO in all displayed xrefs.
|
||||||
|
|
||||||
|
This command interactively replaces FROM with TO in the names of the
|
||||||
|
references displayed in the current *xref* buffer."
|
||||||
(interactive
|
(interactive
|
||||||
(list (read-regexp "Query replace regexp in matches" ".*")
|
(let ((fr (read-regexp "Xref query-replace (regexp)" ".*")))
|
||||||
(read-regexp "Replace with: ")))
|
(list fr
|
||||||
|
(read-regexp (format "Xref query-replace (regexp) %s with: " fr)))))
|
||||||
(let (pairs item)
|
(let (pairs item)
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(progn
|
(progn
|
||||||
@ -762,12 +766,10 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
|
|||||||
With prefix argument or when there's no identifier at point,
|
With prefix argument or when there's no identifier at point,
|
||||||
prompt for it.
|
prompt for it.
|
||||||
|
|
||||||
If the backend has sufficient information to determine a unique
|
If sufficient information is available to determine a unique
|
||||||
definition for IDENTIFIER, it returns only that definition. If
|
definition for IDENTIFIER, display it in the selected window.
|
||||||
there are multiple possible definitions, it returns all of them.
|
Otherwise, display the list of the possible definitions in a
|
||||||
|
buffer where the user can select from the list."
|
||||||
If the backend returns one definition, jump to it; otherwise,
|
|
||||||
display the list in a buffer."
|
|
||||||
(interactive (list (xref--read-identifier "Find definitions of: ")))
|
(interactive (list (xref--read-identifier "Find definitions of: ")))
|
||||||
(xref--find-definitions identifier nil))
|
(xref--find-definitions identifier nil))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user