[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: etags to xref changed navigation
From: |
Eli Zaretskii |
Subject: |
Re: etags to xref changed navigation |
Date: |
Tue, 23 Apr 2024 20:15:45 +0300 |
> From: Phillip Susi <phill@thesusis.net>
> Date: Tue, 23 Apr 2024 13:02:17 -0400
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > The old behavior is supposed to be necessary much less with xref,
> > since xref's search is more accurate, and usually finds only one
> > candidate. So I'd be interested to know in what programming language
> > do you see many candidates, and why.
>
> Typically there is only one *definition*, but many *referenecs*.
Now I'm confused: M-. and M-, were about finding *definitions*, not
references. If you want to find references, you need to type M-?
instead. So I wonder what am I missing here.
> > In addition, you haven't explained why you find the navigation in the
> > XREF buffer slow and cumbersome. Basically, once you switch to the
> > XREF buffer, you can display next/previous candidate with a single
> > key, which is not more typing than "M-," (and there's the ability to
> > select a candidate that is not next or previous, something "M-,"
> > couldn't give you). In addition, you can customize the variable
> > xref-auto-jump-to-first-definition to the value 'move' or 'show', in
> > which case the first candidate will be shown even if there are several
> > candidates.
>
> I find the window splitting to be a bit annoying, and if I want to poke
> around each callsite a bit, I have to keep switching windows with C-o to
> move between exploring, and moving to the next callsite.
You don't need to switch windows if you don't like it. Customize
xref-auto-jump-to-first-definition to the value t, and move between
candidate with "M-g M-n" and "M-g M-p". This way, you never need to
go to the window showing the *xref* buffer. (If you want that for
M-?, customize xref-auto-jump-to-first-xref instead.)
> > If you still want to have the old behavior back, you can rebind M-. to
> > find-tag and M-, to tags-loop-continue, which still exist, just
> > without the default key binding.
>
> Do they still function the same, especially if you are using eglot? I
> thought I checked and found that tags-loop-continue was obsolete/removed
> in emacs 29.
They work the same as they did before, and are obsolete, but not
removed.
They don't support Eglot, of course, since find-tag never did. So if
you want to have Eglot support, I suggest the customization described
above, it should give you the same UX as the old bindings, albeit with
different keys and the *xref* window which will be popped up.
- Re: etags to xref changed navigation, (continued)
- Re: etags to xref changed navigation, Stefan Monnier, 2024/04/22
- Re: etags to xref changed navigation, Phillip Susi, 2024/04/23
- Re: etags to xref changed navigation, Stefan Monnier, 2024/04/23
- Re: etags to xref changed navigation, Eli Zaretskii, 2024/04/23
- Re: etags to xref changed navigation, Stefan Monnier, 2024/04/23
- Re: etags to xref changed navigation, Eli Zaretskii, 2024/04/24
- Re: etags to xref changed navigation, Dmitry Gutov, 2024/04/24
- Re: etags to xref changed navigation, Stefan Monnier, 2024/04/24
- Re: etags to xref changed navigation, Dmitry Gutov, 2024/04/25
Re: etags to xref changed navigation, Phillip Susi, 2024/04/23
- Re: etags to xref changed navigation,
Eli Zaretskii <=
Re: etags to xref changed navigation, Philip Kaludercic, 2024/04/22