From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Patrick Mahan Newsgroups: gmane.emacs.help Subject: Re: Using xref-find-definitions Date: Sat, 7 Oct 2023 00:35:05 -0700 Message-ID: References: <83mswv0y3h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1625"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 07 09:36:05 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 1qp1r3-0000Cg-HI for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 07 Oct 2023 09:36:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qp1qM-0000qb-D2; Sat, 07 Oct 2023 03:35:22 -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 1qp1qK-0000qO-OO for help-gnu-emacs@gnu.org; Sat, 07 Oct 2023 03:35:20 -0400 Original-Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qp1qI-0006Fa-Ng; Sat, 07 Oct 2023 03:35:20 -0400 Original-Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1dd1db54d42so1868438fac.3; Sat, 07 Oct 2023 00:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696664117; x=1697268917; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zjblacj+9BdFShlRGRV4WkTrnGBuI2KrxKC3WB3Z0Bk=; b=QbQsKDZEd4j1CV/H3B0uyXo1Jft+2JkN/2QdE9PjMLrRMvRRK0SG0K0maWawr/CdPc TSB21sqrU5i+Xk2Gs5atNEfXZzLwnukypxN56niBODfE/ydnNDANm2CuNvqUVdmmc1Wt C1iRPzisSNJ4Dz0Cgc/lkugdNDzEC/NNj0CCSqHfz6Hj5sC2yRrg627nFpldGDNJkoMQ Ve2k07R8NP/rLtLjRH4ZXcGHrEOICcptpNox4Q5c3AMgV2RpEAV14Fsa8H9q14Fx9N6K F7euMxsm+eGU1uwh7mJzXOvJENfJger+gaZfN9terXqauQFpJLrAF1W13vNxw325SOln jmmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696664117; x=1697268917; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zjblacj+9BdFShlRGRV4WkTrnGBuI2KrxKC3WB3Z0Bk=; b=H67f2dqbkGeXRqJZ3bXn6dTgSpAunVSrGDZ9KATUl0MBjNTHzOuTlUmKT/NbWSWvf7 3T6qC7LeyzkJ41FNgAa7b4W3vpxmbXM3kkW9Fttv3DX3L+4z/248gkyiSxPJrNzno7xV v95+KRDwMs1nJFtuvJZh+Jqt7vFdI1c6J8k4l865KuHYGU507EBM+BD9fffgMdVbDXqO ZfeTxKV4ZFHyUC0+vY60FGa9cTgH2pBUBkPBpqYjP9eAaeYDrmxYGuAMa3s3joMpG9zj jgYxpIUVQH6hXrwO2MKr9Nwd2C4K1E2VVsFk1QK7j5K3OXnnlrg71pZD4doKlDONsf5q utog== X-Gm-Message-State: AOJu0YxKg8Guzh6XGzm9/GOLjm+t9f06A2k/FHaMTdf6IqxCCVCqfPkF gnpew2E2vktSzvi/k89pQjtW+HF1IXlj1nClfgy+61Ao X-Google-Smtp-Source: AGHT+IG/wsbNlUe38vgyn8lTacYOwnVsJY8zXp245aXEqCB7Mh5wUzwmiEi/GJm25iiARV+8h6djs/kt50tTAA8gOjk= X-Received: by 2002:a05:6870:238f:b0:1c8:39a6:779e with SMTP id e15-20020a056870238f00b001c839a6779emr11333712oap.19.1696664116697; Sat, 07 Oct 2023 00:35:16 -0700 (PDT) In-Reply-To: <83mswv0y3h.fsf@gnu.org> Received-SPF: pass client-ip=2001:4860:4864:20::30; envelope-from=plmahan@gmail.com; helo=mail-oa1-x30.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:145230 Archived-At: On Fri, Oct 6, 2023 at 11:02=E2=80=AFPM Eli Zaretskii wrote: > > 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 =E2=80=98*xref*=E2=80=99 buffer showing the m= atching > candidates. (=E2=80=98C-M-.=E2=80=99 _always_ pops up the =E2=80=98*xr= ef*=E2=80=99 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 > =E2=80=98xref-auto-jump-to-first-definition=E2=80=99 is =E2=80=98move= =E2=80=99, the first of these > candidates is automatically selected in the =E2=80=98*xref*=E2=80=99 bu= ffer, and if it=E2=80=99s > =E2=80=98t=E2=80=99 or =E2=80=98show=E2=80=99, the first candidate is a= utomatically shown in its own > window; =E2=80=98t=E2=80=99 also selects the window showing the first c= andidate. The > default value is =E2=80=98nil=E2=80=99, which just shows the candidates= in the =E2=80=98*xref*=E2=80=99 > buffer, but doesn=E2=80=99t select any of them. > > You are supposed to use these facilities instead of "C-u M-.". Did > you try that? > > Not really since I have not updated my last copy of the emacs manual and I tend to find it clumsy to navigate anyways. I tend to fall back to the Emacs Wiki or rely on google-fu to find my answer. I do use the xref-find-definition commands, via the keystrokes described (M-., CTRL-x 4 ., etc). What I was wanting to stop seeing was the multiple entries because my TAGS tables would have not only the local directory but any identifiers from the sub-directories. That tends to consistently pop-up the other *xref* buffer when I would rather just jump to the first entry found, most of the time. I will miss the option to jump to the next entry, but I suppose then I can always switch to the *xref* buffer and select another definition. But now that `xref-auto-jump-to-first-definition` has been pointed out, I can at least eliminate this annoyance. > My current assumption is that this is due to all of the various TAGS file= s > > that have duplicate entries. Is it time to change how we generate TAGS= ? > > What is the problem with the way you generate TAGS? > > I am waffling on creating hierarchical series of TAGS files as I do currently or to just create one large one at the top of the source tree in an effort to avoid having an identifier seen via multiple TAGS files. Thanks for the feedback, Patrick