diff options
| author | Eli Zaretskii | 2016-01-09 19:06:52 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-01-09 19:06:52 +0200 |
| commit | db3c2a8daaa2a3b887e1b0c5b0aba6f7c0eed752 (patch) | |
| tree | db178354507bc20ca0e5e0eebb44104cb51fdf29 | |
| parent | f6117ef754d9b02433dadaf61e72df0d7391e40a (diff) | |
| download | emacs-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.el | 22 |
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. |
| 211 | Each functions on this hook is called in turn with no arguments | 211 | Each function on this hook is called in turn with no arguments, |
| 212 | and should return either nil to mean that it is not applicable, | 212 | and should return either nil to mean that it is not applicable, |
| 213 | or an xref backend, which is a value to be used to dispatch the | 213 | or an xref backend, which is a value to be used to dispatch the |
| 214 | generic functions.") | 214 | generic 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 | |||
| 507 | This command interactively replaces FROM with TO in the names of the | ||
| 508 | references 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 ...)) ...)." | |||
| 762 | With prefix argument or when there's no identifier at point, | 766 | With prefix argument or when there's no identifier at point, |
| 763 | prompt for it. | 767 | prompt for it. |
| 764 | 768 | ||
| 765 | If the backend has sufficient information to determine a unique | 769 | If sufficient information is available to determine a unique |
| 766 | definition for IDENTIFIER, it returns only that definition. If | 770 | definition for IDENTIFIER, display it in the selected window. |
| 767 | there are multiple possible definitions, it returns all of them. | 771 | Otherwise, display the list of the possible definitions in a |
| 768 | 772 | buffer where the user can select from the list." | |
| 769 | If the backend returns one definition, jump to it; otherwise, | ||
| 770 | display 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 | ||