From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Question about xref and adding "find all references" button to built-in help Date: Tue, 21 Sep 2021 02:37:37 +0300 Message-ID: <78273969-457b-54a3-b85e-0b1fc38ef9c0@yandex.ru> References: <92c5ea92-accc-5bb8-4063-e37b79fcd264@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7983"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 Cc: emacs-devel@gnu.org To: Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 21 01:41:33 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mSSuj-0001vO-Ab for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Sep 2021 01:41:33 +0200 Original-Received: from localhost ([::1]:49518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSSuh-0006Tc-6E for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 19:41:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSSr2-00050B-O8 for emacs-devel@gnu.org; Mon, 20 Sep 2021 19:37:44 -0400 Original-Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:40603) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSSr0-0002j0-C2 for emacs-devel@gnu.org; Mon, 20 Sep 2021 19:37:44 -0400 Original-Received: by mail-wr1-x42e.google.com with SMTP id q26so34068642wrc.7 for ; Mon, 20 Sep 2021 16:37:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=X8nNrfGkaKtpTIiW/Rk7wNkl3jEsbPcnJtGXrZ1ZgAY=; b=PutP74GpR2uJznTlnGpJ80CLuqekYS1oSZLZPCl23Mz9qzHOmOieW5UhJUde1YjLEd 9dBG21qiSSYoUHp4w4kiepFq0a/d8g+9WFhqrNHanqR3u78Z0wu6gqKL8OzzrmU2meKN XgOnO/1h/egy1sPjzwvJNy3RIVEUmt4iKihIyIFl9MNDIOzKk2mOZAtKk4IY5fHowu8h a6KrdWYkD4Jgw/zKemP6Y8y7vTOpzq9CPKrccVSkEdohzv7VdjIsu98S9jixAUYi87eX 1gtZSF2p2QMy4CbWRytvLx6r6diyV2b/+ld/JHVIiCBenxVlCw4YEPLnC+I5dPEO6CMF z8Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=X8nNrfGkaKtpTIiW/Rk7wNkl3jEsbPcnJtGXrZ1ZgAY=; b=JmJ1bRD0vawbZwwlG+z8jiGG8YLiwDTVqrMUrxaFaJaG+cnYeJqg60M0sFbJqyQ2ru o5M+zAjfa4PRzSLWb6VxdnfdwRsXrd0jMAy+6Dj/PpnX9E9/bpvRycb0sZfbqK/WRGZ2 OoU6Sin2v4o95LCENHP8hKY2zSmt40ZUREU2/GGbZkjiuWBTd92OZ5CSUd3wEndhqmMz g3XZdwQ+2geXKdKp75+vlesVgLzgSMsFflRFf5deujcl0NWsIeRmksZVrKQzDCYcI5h9 mShQXr9sLP/HwCEhHPXYFu8Cumo1VIJKtdLH2FRbRN0vR+zCJ39zmOdEJOZFowF7GHZR QRvw== X-Gm-Message-State: AOAM531Wxg7qPaxLQjyRzunU+cy1mvjjgFHKIi0Xi4pbkX6DuV93U1fR ImYW7KEC8AoQRw0+HyeuJ06d2lONj5g= X-Google-Smtp-Source: ABdhPJz3bFSVS3kvQtDjdnTnj5DOMdsoSsNePsq10DuyX5yaT0upjFbA2VRXO/H7x7jWYGHMHpio6g== X-Received: by 2002:a05:600c:4f54:: with SMTP id m20mr1513800wmq.96.1632181059862; Mon, 20 Sep 2021 16:37:39 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id n26sm882096wmi.43.2021.09.20.16.37.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Sep 2021 16:37:39 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=raaahh@gmail.com; helo=mail-wr1-x42e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275176 Archived-At: 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.