From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Using xref-find-definitions Date: Sat, 07 Oct 2023 09:02:10 +0300 Message-ID: <83mswv0y3h.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18366"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 07 08:02:43 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qp0Og-0004Y3-AX for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 07 Oct 2023 08:02:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qp0O3-0004iw-Ug; Sat, 07 Oct 2023 02:02:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qp0O2-0004il-A5 for help-gnu-emacs@gnu.org; Sat, 07 Oct 2023 02:02:02 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qp0O2-0000Zr-1a for help-gnu-emacs@gnu.org; Sat, 07 Oct 2023 02:02:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=DlfA2ept4lNqhDkUi7Ymzy2EwZc5JGuNSN9DmNMiWTA=; b=Kmirr5H/rNuT1WuseUoq 77fLLO+Xj9zWHkhKgeunbrgPnBtkSPHAwTMO/ujBQIZqX5d6xOWS79pR6aF2ynQj3jUpGO2EF0wJr 450q8eJZS/bKlllS0dKzc0krCregNM+n2fp5u5n1UAS/+lvUlByADHtYrcVdyVGOnF10VVjL+GRUE hFooMT6EpX6KTj+3L5Dg5nI9qCSs0Pz2rs8fFGc0HY2GNXQNw/oubXpo/FwszI9mwcnc0COfkUi0C gadFb22cjEvWB+5WWeroEXFE3SADSqMxsYQWv+OXbDqgRzLn/vPRZglsqRubnoyVlVQl4xZurwhAk C9596Kp+NCDPTw==; In-Reply-To: (message from Patrick Mahan on Fri, 6 Oct 2023 11:38:18 -0700) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145228 Archived-At: > From: Patrick Mahan > 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.