diff options
| author | Eli Zaretskii | 2018-08-07 19:15:41 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2018-08-07 19:15:41 +0300 |
| commit | cd9032532d119b35685dc078b8156023122f6dcd (patch) | |
| tree | 54f8add2f858436ae82f70b0c58ed42f4f8124bc | |
| parent | 155a885158c3ea7c2802d2a6c679cdee766a3b28 (diff) | |
| download | emacs-cd9032532d119b35685dc078b8156023122f6dcd.tar.gz emacs-cd9032532d119b35685dc078b8156023122f6dcd.zip | |
Improve documentation of M-?
* doc/emacs/maintaining.texi (Identifier Search):
* lisp/progmodes/xref.el (xref-find-references): Improve
documentation of xref-find-references and
xref-prompt-for-identifier. (Bug#32389)
| -rw-r--r-- | doc/emacs/maintaining.texi | 11 | ||||
| -rw-r--r-- | lisp/progmodes/xref.el | 6 |
2 files changed, 13 insertions, 4 deletions
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 9421691ba76..d7d7eddf621 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -1966,9 +1966,14 @@ Restart one of the last 2 commands above, from the current location of point. | |||
| 1966 | 1966 | ||
| 1967 | @kindex M-? | 1967 | @kindex M-? |
| 1968 | @findex xref-find-references | 1968 | @findex xref-find-references |
| 1969 | @kbd{M-?} finds all the references for the identifier at point. If | 1969 | @kbd{M-?} finds all the references for the identifier at point, |
| 1970 | there's no identifier at point, or when invoked with a prefix | 1970 | prompting for the identifier as needed, with completion. Depending on |
| 1971 | argument, the command prompts for the identifier, with completion. It | 1971 | the current backend (@pxref{Xref}), the command may prompt even if it |
| 1972 | finds a valid identifier at point. When invoked with a prefix | ||
| 1973 | argument, it always prompts for the identifier. (If you want it to | ||
| 1974 | prompt always, customize the value of the variable | ||
| 1975 | @code{xref-prompt-for-identifier} to @code{t}; or set it to @code{nil} | ||
| 1976 | to prompt only if there's no usable identifier at point.) The command | ||
| 1972 | then presents the @file{*xref*} buffer with all the references to the | 1977 | then presents the @file{*xref*} buffer with all the references to the |
| 1973 | identifier, showing the file name and the line where the identifier is | 1978 | identifier, showing the file name and the line where the identifier is |
| 1974 | referenced. The XREF mode commands are available in this buffer, see | 1979 | referenced. The XREF mode commands are available in this buffer, see |
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index b0bdd62ae98..e563951793f 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el | |||
| @@ -866,7 +866,11 @@ buffer where the user can select from the list." | |||
| 866 | ;;;###autoload | 866 | ;;;###autoload |
| 867 | (defun xref-find-references (identifier) | 867 | (defun xref-find-references (identifier) |
| 868 | "Find references to the identifier at point. | 868 | "Find references to the identifier at point. |
| 869 | With prefix argument, prompt for the identifier." | 869 | This command might prompt for the identifier as needed, perhaps |
| 870 | offering the symbol at point as the default. | ||
| 871 | With prefix argument, or if `xref-prompt-for-identifier' is t, | ||
| 872 | always prompt for the identifier. If `xref-prompt-for-identifier' | ||
| 873 | is nil, prompt only if there's no usable symbol at point." | ||
| 870 | (interactive (list (xref--read-identifier "Find references of: "))) | 874 | (interactive (list (xref--read-identifier "Find references of: "))) |
| 871 | (xref--find-xrefs identifier 'references identifier nil)) | 875 | (xref--find-xrefs identifier 'references identifier nil)) |
| 872 | 876 | ||