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 12:05:59 -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="28572"; 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 21:06:55 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 1qpCdb-0007At-5M for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 07 Oct 2023 21:06:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpCd0-00025K-Kk; Sat, 07 Oct 2023 15:06:18 -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 1qpCcy-000252-5p for help-gnu-emacs@gnu.org; Sat, 07 Oct 2023 15:06:16 -0400 Original-Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpCcw-0000bO-4A; Sat, 07 Oct 2023 15:06:15 -0400 Original-Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-1dd8304b980so2148776fac.2; Sat, 07 Oct 2023 12:06:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696705570; x=1697310370; 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=EVxaao8olo+LkQHGEldGCOf8CuFawybZG3JHWJHRIYU=; b=IzoFa5sqWh8zxi08tKnClmb4+VGBlXB6eg6jrVg4eE4eCL5SX6jKNoxShmETcGC0I3 jTW5P9VbNJOlCb3cWdWzotinfch7XdXO0p2SDdz3Qq66vTRMXd9RspQclSsnN/X2KkFe 2u1y4wSFyc4zwGvWxKV7OTxJfcKvy/hRgcrdfwtqykf+dCzP+7WF8U1O2xUGsLXdz1Uf SMMyoYXLh2comr/iS0eceohXz4hYArafh/+ZJ1Gv1vBYwR+/5/8fMUbKVEbvAloLb+x2 YvDo+nHheFsMha8qTyT0l/c5wKQr/q+zZma+LpiOxVLI6+bVNfe5EwJA1t2WdIRO/1QX 1KZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696705570; x=1697310370; 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=EVxaao8olo+LkQHGEldGCOf8CuFawybZG3JHWJHRIYU=; b=ZFyjmjzVRcrYHOJjwKdew1s8it2ZkNQfS6WwiL4htDGO0durYp3X1t+nd00lRyxeUa Vhz4D68jRAX1+zE0a9G3DY7WFCGan5/KuhMSXMbBJsxcZwV5cTkE35cwpx6OFVxWNmLR luT1PbHNvXfOdMXhTDeAecnHDXiRfhPSdsFLTrJONg3e5jY/5AI/y4Ob0AUhJnqzlZk/ 250j1Gj12Jhbcw5TJ9bc2T8ryU5tBPkLyCVMOBk2Puy8WtymapB+WbiO2YUbXwBMSM2E ShVKv/W6wrHs1ygDGQEbpviYz1xqotm6n2ZRRSH5iW5VOMU07eCrr2fuei7zUtNIwUXA utGg== X-Gm-Message-State: AOJu0Yx/hR2JhHR14svb3FMLU7odDpzNQ+19T/YVKCX5ED4tfG/OpOFa 9/Ugqh3uCpLDHBhA462B0c9QcW5df7eFQDs8J0iqhlqY33c= X-Google-Smtp-Source: AGHT+IEJpp0wUrmSn5azGaKIfxCUJUtcbBxcSQtFBkqlnF+pdEtjcuAE14RSz/LuTU969u0cyzFjN9OtY9V/zoP5NGY= X-Received: by 2002:a05:6871:593:b0:1d6:d93d:6803 with SMTP id u19-20020a056871059300b001d6d93d6803mr13598617oan.33.1696705570491; Sat, 07 Oct 2023 12:06:10 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2001:4860:4864:20::2d; envelope-from=plmahan@gmail.com; helo=mail-oa1-x2d.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:145243 Archived-At: On Sat, Oct 7, 2023 at 12:35=E2=80=AFAM Patrick Mahan w= rote: > On Fri, Oct 6, 2023 at 11:02=E2=80=AFPM Eli Zaretskii wrot= e: > >> > 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 coul= d >> 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 definitio= n, >> it by default pops up the =E2=80=98*xref*=E2=80=99 buffer showing the = matching >> candidates. (=E2=80=98C-M-.=E2=80=99 _always_ pops up the =E2=80=98*x= ref*=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 b= uffer, and if it=E2=80=99s >> =E2=80=98t=E2=80=99 or =E2=80=98show=E2=80=99, the first candidate is = automatically shown in its own >> window; =E2=80=98t=E2=80=99 also selects the window showing the first = candidate. The >> default value is =E2=80=98nil=E2=80=99, which just shows the candidate= s 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 entr= y, > 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. > > Hmmm, obviously I spoke too soon. I did mention in my original post that I was using emacs 25.2. It turns out that `xref-auto-jump-to-first-definition` does not exist in the xref.el shipped with emacs 25.2. It looks like I need to fallback to the solution proposed here - https://emacs.stackexchange.com/questions/61384/how-to-go-to-the-first-defi= nition-with-xref-find-definitions-do-not-show-all-op Just in case somebody else is in my situation. Thanks, Patrick