emacs-devel
[Top][All Lists]
Advanced

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

Re: Question about xref and adding "find all references" button to built


From: Dmitry Gutov
Subject: Re: Question about xref and adding "find all references" button to built-in help
Date: Mon, 20 Sep 2021 15:49:43 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 20.09.2021 08:47, Arthur Miller wrote:
Dmitry Gutov <dgutov@yandex.ru> writes:

Hi!

On 19.09.2021 23:17, Arthur Miller wrote:
If I would like to add a link as there is one in Helpful, to find all references
for a current symbol in help-mode buffer; which xref functionality should I look
at? Is there a ready made function already, or do I have to write something?

We have functionality to searching for references in the current project (also
works when inside an Emacs sources checkout) and throughout the load-path.

As extensive as helpful's help-ref? He searches through each and every source
file found in the load-path. Where do I look, can you give me some pointer I can
start playing with? Or should I do build my own search?

That's just 'M-x xref-find-references'. Try it in an Elisp buffer.

The implementation is fairly simple: see 'xref-backend-references' in xref.el and elisp-load-path-roots.

For your own backend, you will probably not dispatch through project.el method, and use load-path directly combined with package-user-dir. Maybe after pruning it for entries that reside inside other entries.

But you probably want this to work in installed Emacs as well?

What do you mean by "installed Emacs"? Emacs without sources? Sorry, I just woke
up, have to get that coffein going up :).

Without sources or with compressed sources.

What about to just have a keyboard shortcuts; say 'R', instead of link. With
source code displayed it already looks a bit crouded. I think helpfuls buffer
looks a bit busy with all the links.

I could imagine living with just a shortcut and maybe a context menu item.

I don't really have an opinion on the UI part of this. It can be a button, command, whatever.

I attached a screeshots of helpful and built-in help with my yserdays patch both
showing source code for the comparison.

UI for references and definitions will probably need to be different, no?



reply via email to

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