bug#81624: New command: xref-find-by-kind
Dmitry Gutov <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
On 18/08/2026 17:01, João Távora wrote: >> Couldn't really decide, flipped a coin. But if we flip it back, the >> command definitions get even smaller: >> >> (defun eglot-find-declaration (identifier) >> "Find declarations for IDENTIFIER." >> (interactive (list (xref-read-identifier "Find declarations of: "))) >> (xref-find-by-kind identifier 'declaration)) > I definitely think you should do this -- i.e. flip back -- the other one > is repeating a database entry. Consulting this small database should be > cheap. Again, if you really want to do it by the book, make the > database in Lisp symbols: use a separate obarray and 'intern-soft' (the > poor man's elisp equivalent to FIND-SYMBOL+package of proper civilized > Lisps). Very good, I've pushed this version. Yeah, it's not really about noticeable performance, just about throwing away a usable value. Regarding obarray, I think you're either describing a caching scheme (indefinite or timed) or a more complex return value for xref-backend-xref-kinds.