unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Using xref-find-definitions
Date: Sat, 07 Oct 2023 09:02:10 +0300	[thread overview]
Message-ID: <83mswv0y3h.fsf@gnu.org> (raw)
In-Reply-To: <CAFDHx1KyipKugLKcSCR4bSXqJJu4znabM-XE1WeWLJ_Oo=Z4Fg@mail.gmail.com> (message from Patrick Mahan on Fri, 6 Oct 2023 11:38:18 -0700)

> From: Patrick Mahan <plmahan@gmail.com>
> Date: Fri, 6 Oct 2023 11:38:18 -0700
> 
> An *xref* buffer appears with the following -
> /home/pmahan/workspaces/myos/src/bin/mserv/appclass/my_ipserv.c
> 109: void flow_log(
> /home/pmahan/workspaces/myos/src/bin/mserv/appclass/my_ipserv.c
> 109: void flow_log(
> 
> When I was using find-tag, it would give me the first hit, then I could do
> CTRL-u M-. to go to the next entry.  I would not have this presented.  In
> the new method, this is churning my buffer displays around which is
> annoying, especially when the entry is in the same code module.

I don't understand this description.  Can you explain in more detail
what happens with Xref and why this is annoying?

The Emacs user manual says about M-. and similar commands:

     If any of the above commands finds more than one matching definition,
  it by default pops up the ‘*xref*’ buffer showing the matching
  candidates.  (‘C-M-.’ _always_ pops up the ‘*xref*’ buffer if it finds
  at least one match.)  The candidates are normally shown in that buffer
  as the name of a file and the matching identifier(s) in that file.  In
  that buffer, you can select any of the candidates for display, and you
  have several additional commands, described in *note Xref Commands::.
  However, if the value of the variable
  ‘xref-auto-jump-to-first-definition’ is ‘move’, the first of these
  candidates is automatically selected in the ‘*xref*’ buffer, and if it’s
  ‘t’ or ‘show’, the first candidate is automatically shown in its own
  window; ‘t’ also selects the window showing the first candidate.  The
  default value is ‘nil’, which just shows the candidates in the ‘*xref*’
  buffer, but doesn’t select any of them.

You are supposed to use these facilities instead of "C-u M-.".  Did
you try that?

> My current assumption is that this is due to all of the various TAGS files
> that have duplicate entries.  Is it time to change how we generate TAGS?

What is the problem with the way you generate TAGS?

You could, of course, generate just one TAGS file instead of having a
TAGS file in each directory, but duplicate entries can happen anyway.

> Or can I configure xref-find-definitions to handle this situation.

See above.



  reply	other threads:[~2023-10-07  6:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 18:38 Using xref-find-definitions Patrick Mahan
2023-10-07  6:02 ` Eli Zaretskii [this message]
2023-10-07  7:35   ` Patrick Mahan
2023-10-07 19:05     ` Patrick Mahan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mswv0y3h.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).