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: Arthur Miller
Subject: Re: Question about xref and adding "find all references" button to built-in help
Date: Tue, 21 Sep 2021 12:32:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 20.09.2021 23:52, Arthur Miller wrote:
>
>>> 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.
>> Thank you that was what I needed. I have tried it, will have to test and look
>> around a bit more.
>> 
>>> 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.
>> Yes probably. I thought I could skip writing a backend; but i'll see.
>
> I think it might be easier to defined a separate backend (say, called
> 'elisp-help), but go ahead and experiment.
Will do, thanks for the tips.

>>>>> 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.
>> Yes. Maybe it would be possible to search in elc files? I mean some functions
>> have opcodes, but more are called by name. But I meant just when sources are
>> avialable, when 'source-directory' is not nil.
>
> I don't know. Searching compressed sources (after the user installs them) 
> might
> be a closer goal.
>
> Or perhaps this feature will be mostly used by people who already have an 
> Emacs
> sources checked out anyway.
User have to have sources installed; I don't plan on parsing elc files, it was
more of a wild thought, but to get somthing going, user would need to have
sources installed in some way; compressed, uncompressed or dev sources. I don't
know though if I have to decompress sources myself or Emacs does that
auto. Nobody cared to answer any of questions I asked in the patch proposal for
the source inlined in help buffers. 

>>>> 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?
>> A whole ui? :) I just meant a key, like for sources of info view. Helpful has
>> a
>> link, but I would like to skip the link.
>
> Ah, I see it now. You wanted to show the "Find all references" button printed 
> by
> Helpful.

Yeah. But without the button :). You were thinkng on the presentation of
results? For there I just meant a buffer with a list of links or buttons, I
don't know what else. Would there be some better option?



reply via email to

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