unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Arthur Miller <arthur.miller@live.com>
Cc: emacs-devel@gnu.org
Subject: Re: Question about xref and adding "find all references" button to built-in help
Date: Tue, 21 Sep 2021 02:37:37 +0300	[thread overview]
Message-ID: <78273969-457b-54a3-b85e-0b1fc38ef9c0@yandex.ru> (raw)
In-Reply-To: <AM9PR09MB497788A3D22B28BB4E4BB0EF96A09@AM9PR09MB4977.eurprd09.prod.outlook.com>

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.

>>>> 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.

>>> 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.



  reply	other threads:[~2021-09-20 23:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-19 20:17 Question about xref and adding "find all references" button to built-in help Arthur Miller
2021-09-19 23:32 ` Dmitry Gutov
2021-09-20  5:47   ` Arthur Miller
2021-09-20 12:49     ` Dmitry Gutov
2021-09-20 20:52       ` Arthur Miller
2021-09-20 23:37         ` Dmitry Gutov [this message]
2021-09-21 10:32           ` Arthur Miller
2021-09-21 14:02             ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78273969-457b-54a3-b85e-0b1fc38ef9c0@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=arthur.miller@live.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).