1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 14:30:50 -08:00

Improve documentation of selection and navigation in *xref* buffers

* doc/emacs/maintaining.texi (Looking Up Identifiers): More
detailed description of 'xref-auto-jump-to-first-definition'.
Improve indexing.  Describe the use of 'next-error' and
'previous-error' in conjunction with the *xref* buffer.
(Identifier Search): More detailed description of
'xref-auto-jump-to-first-xref'.  Describe the use of 'next-error'
and 'previous-error'.
This commit is contained in:
Eli Zaretskii 2024-04-23 10:40:50 +03:00
parent 2a53351492
commit 81476fa19e

View file

@ -2334,19 +2334,33 @@ documentation for details.
@vindex xref-auto-jump-to-first-definition @vindex xref-auto-jump-to-first-definition
If any of the above commands finds more than one matching If any of the above commands finds more than one matching
definition, it by default pops up the @file{*xref*} buffer showing the definition, it by default pops up the @file{*xref*} buffer showing the
matching candidates. (@kbd{C-M-.}@: @emph{always} pops up the matching candidates and selects that buffer's window. (@kbd{C-M-.}@:
@file{*xref*} buffer if it finds at least one match.) The candidates @emph{always} pops up the @file{*xref*} buffer if it finds at least
are normally shown in that buffer as the name of a file and the one match.) Each candidate is normally shown in that buffer as the
matching identifier(s) in that file. In that buffer, you can select name of a file and the matching identifier(s) in that file. In that
any of the candidates for display, and you have several additional buffer, you can select any of the candidates for display, and you have
commands, described in @ref{Xref Commands}. However, if the value of several additional commands, described in @ref{Xref Commands}.
the variable @code{xref-auto-jump-to-first-definition} is @code{move}, However, if the value of the variable
the first of these candidates is automatically selected in the @code{xref-auto-jump-to-first-definition} is @code{move}, Emacs
@file{*xref*} buffer, and if it's @code{t} or @code{show}, the first automatically moves point to the first of these candidates in the
candidate is automatically shown in its own window; @code{t} also @file{*xref*} buffer, so just typing @key{RET} will display the
selects the window showing the first candidate. The default value is definition of that candidate. If the value of the variable is
@code{nil}, which just shows the candidates in the @file{*xref*} @code{t} or @code{show}, the first candidate is automatically shown in
buffer, but doesn't select any of them. its own window; @code{t} also selects the window showing the first
candidate's definition, while @code{show} leaves the window of the
@file{*xfer*} buffer selected. The default value is @code{nil}, which
just shows the candidates in the @file{*xref*} buffer, but neither
selects any of them nor shows their definition, until you select a
candidate in the @file{*xref*} buffer.
@findex next-error, in @file{*xref*} buffer
@findex previous-error, in @file{*xref*} buffer
@kindex M-g M-n, for navigation in @file{*xref*} buffer
@kindex M-g M-p, for navigation in @file{*xref*} buffer
If you switch away of the window showing the @file{*xref*} buffer
which displays several candidates, you can move from one candidate to
another using the commands @w{@kbd{M-g M-n}} (@code{next-error}) and
@w{@kbd{M-g M-p}} (@code{previous-error}). @xref{Compilation Mode}.
@kindex M-, @kindex M-,
@findex xref-go-back @findex xref-go-back
@ -2509,12 +2523,17 @@ referenced. The XREF mode commands are available in this buffer, see
@vindex xref-auto-jump-to-first-xref @vindex xref-auto-jump-to-first-xref
If the value of the variable @code{xref-auto-jump-to-first-xref} is If the value of the variable @code{xref-auto-jump-to-first-xref} is
@code{t}, @code{xref-find-references} automatically jumps to the first @code{t}, @code{xref-find-references} automatically jumps to the first
result and selects the window where it is displayed. If the value is result in the @file{*xref*} buffer and selects the window where that
@code{show}, the first result is shown, but the window showing the reference is displayed; you can select the other results with
@w{@kbd{M-g M-n}} (@code{next-error}) and @w{@kbd{M-g M-p}}
(@code{previous-error}) (@pxref{Compilation Mode}). If the value is
@code{show}, the first result is displayed, but the window showing the
@file{*xref*} buffer is left selected. If the value is @code{move}, @file{*xref*} buffer is left selected. If the value is @code{move},
the first result is selected in the @file{*xref*} buffer, but is not the first result is selected in the @file{*xref*} buffer, but is not
shown. The default value is @code{nil}, which just shows the results displayed; you can then use @key{RET} to actually display the
in the @file{*xref*} buffer, but doesn't select any of them. reference. The default value is @code{nil}, which just shows the
results in the @file{*xref*} buffer, but doesn't select any of them,
and doesn't display the reference itself.
@findex xref-query-replace-in-results @findex xref-query-replace-in-results
@kbd{r} (@code{xref-query-replace-in-results}) reads a @var{replacement} @kbd{r} (@code{xref-query-replace-in-results}) reads a @var{replacement}