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

Dmitry Gutov <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
On 18/08/2026 14:06, Sean Whitton wrote:

> It's difficult to think about this in the absence of more detailed user
> documentation.  Could you write up the manual entries, perhaps including
> some examples of what sort of kinds might be available for a language?

I've added a manual entry in commit ceb0173179b, hope it helps. It 
rehashes what is already written in docstrings (not sure what to add, 
please ask), but maybe a summary like that would give a new impression.

> The main entry point user command's docstring should say what is prompts
> for.  Presumably you have to be asked for the kind and then the symbol.
> Which one comes first?

In the order they're mentioned: first the kind, then the identifier.

> Are they both minibuffer prompts or do you get
> an *xref* buffer at some point?
Both of them are minibuffer prompts, you get an *xref* buffer at the 
end. The first prompt (mandatory) uses 'read-multiple-choice', asking 
the user to type the character that corresponds to the desired kind. 
Which makes it function like a dynamic keymap (possibly avoiding the 
need for separate commands, discussed previously).

Then, if there is no identifier at point or if called with C-u, it reads 
the identifier, with completion. In Elisp mode, since today, it also 
filters the identifiers to only show matching the specified kind.

So for example you can type "C-u M-' c" and see the defined faces as 
completions. This is opt-in: a bit harder to do the same in Eglot.
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.