aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2016-01-09 19:06:52 +0200
committerEli Zaretskii2016-01-09 19:06:52 +0200
commitdb3c2a8daaa2a3b887e1b0c5b0aba6f7c0eed752 (patch)
treedb178354507bc20ca0e5e0eebb44104cb51fdf29
parentf6117ef754d9b02433dadaf61e72df0d7391e40a (diff)
downloademacs-db3c2a8daaa2a3b887e1b0c5b0aba6f7c0eed752.tar.gz
emacs-db3c2a8daaa2a3b887e1b0c5b0aba6f7c0eed752.zip
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.
-rw-r--r--lisp/progmodes/xref.el22
1 files changed, 12 insertions, 10 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 59700115879..fe39122d24f 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -208,7 +208,7 @@ LENGTH is the match length, in characters."
208 208
209(defvar xref-backend-functions nil 209(defvar xref-backend-functions nil
210 "Special hook to find the xref backend for the current context. 210 "Special hook to find the xref backend for the current context.
211Each functions on this hook is called in turn with no arguments 211Each function on this hook is called in turn with no arguments,
212and should return either nil to mean that it is not applicable, 212and should return either nil to mean that it is not applicable,
213or an xref backend, which is a value to be used to dispatch the 213or an xref backend, which is a value to be used to dispatch the
214generic functions.") 214generic functions.")
@@ -502,10 +502,14 @@ WINDOW controls how the buffer is displayed:
502 (xref--pop-to-location xref window))) 502 (xref--pop-to-location xref window)))
503 503
504(defun xref-query-replace (from to) 504(defun xref-query-replace (from to)
505 "Perform interactive replacement in all current matches." 505 "Perform interactive replacement of FROM with TO in all displayed xrefs.
506
507This command interactively replaces FROM with TO in the names of the
508references displayed in the current *xref* buffer."
506 (interactive 509 (interactive
507 (list (read-regexp "Query replace regexp in matches" ".*") 510 (let ((fr (read-regexp "Xref query-replace (regexp)" ".*")))
508 (read-regexp "Replace with: "))) 511 (list fr
512 (read-regexp (format "Xref query-replace (regexp) %s with: " fr)))))
509 (let (pairs item) 513 (let (pairs item)
510 (unwind-protect 514 (unwind-protect
511 (progn 515 (progn
@@ -762,12 +766,10 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
762With prefix argument or when there's no identifier at point, 766With prefix argument or when there's no identifier at point,
763prompt for it. 767prompt for it.
764 768
765If the backend has sufficient information to determine a unique 769If sufficient information is available to determine a unique
766definition for IDENTIFIER, it returns only that definition. If 770definition for IDENTIFIER, display it in the selected window.
767there are multiple possible definitions, it returns all of them. 771Otherwise, display the list of the possible definitions in a
768 772buffer where the user can select from the list."
769If the backend returns one definition, jump to it; otherwise,
770display the list in a buffer."
771 (interactive (list (xref--read-identifier "Find definitions of: "))) 773 (interactive (list (xref--read-identifier "Find definitions of: ")))
772 (xref--find-definitions identifier nil)) 774 (xref--find-definitions identifier nil))
773 775