emacs-devel
[Top][All Lists]
Advanced

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

Re: Xref completion


From: João Távora
Subject: Re: Xref completion
Date: Wed, 18 Nov 2020 18:47:20 +0000

On Wed, Nov 18, 2020 at 7:36 AM William Xu <william.xwl@gmail.com> wrote:
Dmitry Gutov <dgutov@yandex.ru> writes:

> On 17.11.2020 23:16, William Xu wrote:
>> (defun my-xref--show-defs-minibuffer (fetcher alist)
>>    (let* ((xrefs (funcall fetcher))
>>           (xref-alist (xref--analyze xrefs))
>>           (xref (if (not (cdr xrefs))
>>                     (car xrefs)
>>                   (cadr (assoc (completing-read "Jump to definition: " xref-alist)
>>                                xref-alist)))))
>>      (xref-pop-to-location xref (assoc-default 'display-action alist))))
>
> A solid try, but note you might have a problem when there are several
> matches in the same file: you won't be able to navigate to any but the
> first one.
>
> Of course, depending on your current programming language, this might
> be not important.

In that case, we can just prepend the line and summary in front of the filename?

I'd just like to note that in certain applications (like SLY/SLIME where this request 
hails from), sometimes xrefs are grouped not by file, but by type (a symbols's
references includes "who sets", "who calls", "who reads", and so on) . So
if possible, and in general, this type of solution should be thought as
"prepend/append group name".  There can even be multiple grouping
strategies.

But one can also think about: select group first, then item within group.

Just my two cents.
João

reply via email to

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