From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Question about xref and adding "find all references" button to built-in help Date: Tue, 21 Sep 2021 12:32:58 +0200 Message-ID: References: <92c5ea92-accc-5bb8-4063-e37b79fcd264@yandex.ru> <78273969-457b-54a3-b85e-0b1fc38ef9c0@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34845"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 21 12:36:24 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 1mSd8R-0008lz-Qs for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Sep 2021 12:36:23 +0200 Original-Received: from localhost ([::1]:37616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSd8Q-0004YW-8M for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Sep 2021 06:36:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSd5H-0007oM-2F for emacs-devel@gnu.org; Tue, 21 Sep 2021 06:33:07 -0400 Original-Received: from mail-oln040092066050.outbound.protection.outlook.com ([40.92.66.50]:3907 helo=EUR01-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSd5E-0004Ah-G8 for emacs-devel@gnu.org; Tue, 21 Sep 2021 06:33:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J8tqe0qXoz1EgwnNldr+Vkeg+pb3uIvRoJtouODfAK+LQADEn48pa0nPfUo9B5OKhaVU4f8aVvxUDeR0/4RUSTLp0V15IWmmsT12KGWzTHLYfSG1biahuVrRW97mY1qx+9d4xEgrgfmsunGG75ZdJn9v7N2ddYmEfuAIWA291WO6lKvZ86d9yHGxKKQ2/L4fqwiSlmUEJRul/wCDU1xlyRbAqckhwOL2JN19HyJNgYwMc1htGLhwnv/w5T07CsnR6U4Jv80+43f0EsTCR/R6eQ4w1MGPbUsXABvoMGjP7VpRzj4TH37CgG31JimOYPjnmgH/K8itu9D7Hj46TLQtXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TmhiieKtxgAju51AnI4tZirPGCFlvqUxXT8w0/1xh2M=; b=YmyUlyPpBh9bhPzdTP6NKdoS2UNMXZYSg6tQON1IgdGs9LjOJCVda4nKn13l9AJRhi4+flmewmzHb8+cORs2HK6ZxmVkxWQy07fPe1qbE57lBwyo/4d4YlR2fQk6ZTpvh0oJJZS7r1w0mvjEYv3ZVyewgDO5361BTgt5RWIUzrvGQ5+819F0ywTjpPGXJmOAsrdOL3nXU5wbvaugmjHUtmHlg9jt06fhsR8GPbCtBCY1ZZykx68/pyzeBfQH/2mWqnCx85AR2XcU1EFfV2XNX8Ng6CKeUGWv5NKybFp51B73PBt9JJHtWE8y6cqxuszcVNVQlXnzuXJDdrWPO8mVqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TmhiieKtxgAju51AnI4tZirPGCFlvqUxXT8w0/1xh2M=; b=ou8PT022ZuqZ9SmWtHnRu/Kie4qYCvflQfeB/vzAKoYrHRDg66ym1fli1oAHdb3jkIoy0zUujJKds1PE7VbFS8F2mb+kD0IjV+YEyxK6kHW7xdpYVqVUzxY6hw23h+oBKNrKRw4t3RLdg9c4W5xZJzlsNlNbY0SjeH5JeaLNVZx2WJ3vEPNRJiWNwFHwxJiteIUpjED2dRh+OGbwtp3HpxQJqdhDBlFQ1JGlx8X6RCq1FIdZut6P5BGW5DzqcsE0oi8LxdPXPhxqk7FIZ3vlHd9njt2wNk5wEX85nwpr2Tf8DV11ahnwOMMADVg8vGR6LZvjyH7sab4MPozKmw03lg== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB3987.eurprd09.prod.outlook.com (2603:10a6:208:19a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16; Tue, 21 Sep 2021 10:33:00 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::c55c:ece5:bed2:a9dc%9]) with mapi id 15.20.4544.013; Tue, 21 Sep 2021 10:33:00 +0000 In-Reply-To: <78273969-457b-54a3-b85e-0b1fc38ef9c0@yandex.ru> (Dmitry Gutov's message of "Tue, 21 Sep 2021 02:37:37 +0300") X-TMN: [7rZFFor2G3QB3KrFlbafuuAaXG7am4sP] X-ClientProxiedBy: HE1PR05CA0168.eurprd05.prod.outlook.com (2603:10a6:3:f8::16) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <878rzqrzfp.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by HE1PR05CA0168.eurprd05.prod.outlook.com (2603:10a6:3:f8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Tue, 21 Sep 2021 10:32:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a37cd5d-5c99-4051-9e4d-08d97ceb2f2d X-MS-TrafficTypeDiagnostic: AM0PR09MB3987: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TRTLJA3JzMbr8dWELYP2uYiIdOw1ywknSJmZMX/psKX6XgmVDIzQFFCXIHYErvRf/pCfSjCKbJS8AS1hRJ79RLo+jhzsTLT4huARoMcJXgfjkAqag5n9ThChlzne5z18Hxp+cQsz0Odkjs96U8xcY9JvXTCQWfZmqt6oVIpZ/a6pg1gJhcQ0+jCJab6K8nklb51LICONYBEmP1LHhiBzLaf8Y5Bnwa07e/vefnYfggmGiJIBdAwqZwS0N/hC10cQmCgpKnMmpptChY880jrX3WXMgG3/svc4S4VqpB1Npf24Rep29NnnNMsPRI3n/AWPkuDALT1fna+aUAsZgTlbekGzgLxd92mL+msvHhlEdXPB3DFqgFhDK5ZG3hXi34NdU27BguPZCJQme9U3WLFbrmTItMwUrHtmTwAR6/wz8+6pKjdk+4e6cL4ReWuoIXKo X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FODKtp88jba0OI7kd5P+NuVU+yhXFhG/3h8ttjxbmzbG6qrnafF49HKtjESuMnWeDpR025G0ul3QrfWkGBVK+bq8zL8rSoLE/ni0oMIM+ROoQlQlqfuVzM20EkpQwdMU800iB55c45p4nMvDUQf46w== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-72e6e.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 9a37cd5d-5c99-4051-9e4d-08d97ceb2f2d X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2021 10:33:00.4007 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR09MB3987 Received-SPF: pass client-ip=40.92.66.50; envelope-from=arthur.miller@live.com; helo=EUR01-VE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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:275215 Archived-At: Dmitry Gutov 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?