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