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: Mon, 20 Sep 2021 15:49:43 +0300 Message-ID: <92c5ea92-accc-5bb8-4063-e37b79fcd264@yandex.ru> References: 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="13930"; 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 Mon Sep 20 14:51:43 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 1mSIlr-0003Od-HN for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 14:51:43 +0200 Original-Received: from localhost ([::1]:35058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSIlp-00013C-Mz for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 08:51:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSIk2-0008Uq-5z for emacs-devel@gnu.org; Mon, 20 Sep 2021 08:49:50 -0400 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:43825) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSIk0-0004K4-7T for emacs-devel@gnu.org; Mon, 20 Sep 2021 08:49:49 -0400 Original-Received: by mail-wr1-x436.google.com with SMTP id w17so21198362wrv.10 for ; Mon, 20 Sep 2021 05:49:47 -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=wqZsblgVdyuTW8AF6q0hymvoScfiVdd5kKZPDX/dahY=; b=gpZp8AujEQeuuH266Hchrc6lFJJW2FRpm7SP0bnAa99mqFg7V6iBZOSfmuotu9LX2j vs4A+DrTTOm8POM8Fj8KSpS62Wma2muNbY2xWdv5dDZ0kNfMbb1sVY9PMHHpa8YMPQTU OWdwp9azm7u0R3TrR5Xt4R2TukPaJ/9M23EUs2GE26xoZtW0Zvo5kU6NKdLM9VGpeG1U Ywchp+rW0m9/aFoE8NAfk4SWgcnX/qYqOiP8lTir2iBYIxQlKJK0lA4Hr/+sJuhiO3uO kzzidA2ijLwBMGRGNeI3uXhp8WZyRdJ0wf6q3BwG7mc749tIp8Y9Ol4Htiz+1QYQ68F5 ob/A== 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=wqZsblgVdyuTW8AF6q0hymvoScfiVdd5kKZPDX/dahY=; b=Lc2qPG0+37kNmXGYDHXG0ie45z57752BQJKhlI5Eu3vR58IHIuwRxcfZDnamzzvB79 TKm7BhQg+God/T4u0xI181g1SXGg6TxKS2IbUe0wDINyN1+bm0ty+X+ojIeMekCQhYG9 ApPVMRKfRmpB9lcpc/+tGktWNd4kDjRqMOMkYY45i8JSDdFPjkjHMhaH8dst5U7407o4 iMuRptEfZrOutmab+B13USWkVVwGGPXv8XACbzIFBt6B6LzZ1qMRsoYS6SUGjIkM1WJ6 71RHBGqeaeYDyaUW8juDH4HssOhuK4CQZzWoHXiAXRlVcUv+p5hedUl+r9NSmU4JtXl4 lAoA== X-Gm-Message-State: AOAM532jFXk0mcXNfOva5v3f03oiYlpLof6QMpjxPi1qZJkxYIVjRC0z bJUZ7acyvZyDzvoqGv3xnBKfWRVdxn4= X-Google-Smtp-Source: ABdhPJwhl2MBEGVNBQ34pZfjOOwaTZxFxRMR8tBulSnlzDFUkNtn4HWGYWol9UORajdB3l7ihUC35g== X-Received: by 2002:adf:8919:: with SMTP id s25mr28708462wrs.185.1632142186633; Mon, 20 Sep 2021 05:49:46 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id v188sm5445186wme.38.2021.09.20.05.49.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Sep 2021 05:49:46 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=raaahh@gmail.com; helo=mail-wr1-x436.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:275126 Archived-At: On 20.09.2021 08:47, Arthur Miller wrote: > Dmitry Gutov 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?