bug#81624: New command: xref-find-by-kind

Dmitry Gutov <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
On 19/08/2026 01:22, João Távora wrote:
> You get the idea... You can do this mostly in Elisp if you really want
> to, but I admit it's a bit awkward, because there's no named obarrays
> and no read syntax for them.  So the elegant last line would become an
> odd intern-soft with an extra arg.  Now that I think of it, not sure the
> Elisp version really avoids your "coin-flip" problem, because
> intern-soft does a runtime lookup anyway, whereas in CL that job is done
> at read-time and the right symbol reference is already compiled in.

It sounds like we could model this using an alist or a hash-table too, 
just with a different performance characteristics.

What makes an elegant solution difficult, even in theory, is that 
xref--read-kind a) loops through all values, b) does a lookup by :key.

But xref-find-by-kind's body does a lookup by :kind. And using two 
hash-tables for this would be ridiculous by any standards.

> Anyway, this is just academic, these lookups are super cheap, don't do
> it 🙂

Yep :)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.