emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xref completion


From: Dmitry Gutov
Subject: Re: Xref completion
Date: Sat, 5 Dec 2020 23:02:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 05.12.2020 14:21, William Xu wrote:
Dmitry Gutov <dgutov@yandex.ru> writes:

I've pushed it now with some changes, hope you all like the result.

Shortening the group part (in most common cases) is among them.

Also added some highlighting with corresponding xref faces. It now
looks closer to Pierre's original screenshot.

The result looks nice.

Thanks.

Removed the bit of logic that hid the summaries when they are
technically unnecessary because in my testing it made completion
slightly less useful by hiding information (sorry).

If the summary contains different info, like the actual line from the
group (in case it is a file), that may be useful to show it, for
example:

/foo.cpp:40:struct Foo : Bar
/foo2.cpp:42:struct Foo : Foo2

That's how it usually looks in my testing, with the etags backend. E.g.:

Possible completions are:
dispextern.h:2703:  int vpos;
indent.h:29:    EMACS_INT vpos;
window.h:97:  int hpos, vpos;

(After I try to navigate to the definitions 'vpos' from xdisp.c:1499).

Of course, in the end it depends on each backend to put useful into into summaries. And in the case of etags, that depends on how the definition is written (that the identifier is not alone on its line).

However, at the moment it only shows the same summary info for each
line, which doesn't seem really useful:

/foo.cpp:40:Foo
/foo2.cpp:42:Foo

Which backend is this? Also etags?

Or one can also just add this info into the reading prompt:
     (format "Jump to definition of `%s': " summary)

I suppose it could be a special case, but we'd have to pipe through the initial input as well (it's not currently available). So hopefully there is some better solution.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]