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: Mon, 20 Sep 2021 22:52:51 +0200 Message-ID: References: <92c5ea92-accc-5bb8-4063-e37b79fcd264@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="30820"; 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 Mon Sep 20 22:58: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 1mSQN7-0007oF-8T for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 22:58:42 +0200 Original-Received: from localhost ([::1]:53828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSQN5-0007qj-9M for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 16:58:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSQMS-0007AD-7r for emacs-devel@gnu.org; Mon, 20 Sep 2021 16:58:00 -0400 Original-Received: from mail-am5eur03olkn082e.outbound.protection.outlook.com ([2a01:111:f400:fe08::82e]:8772 helo=EUR03-AM5-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 1mSQMO-0005Un-LH for emacs-devel@gnu.org; Mon, 20 Sep 2021 16:57:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Exo/9zKOlbYDTRSyN8nOeD8QRfQtuhU+R2WzlW9wvmr7RX1RH5KW3/fqJfeea+71oOhQjw/ms5iu569A/frSEjuWvQq2bhbOopocRnC/RJ0C18xCZyE7xhexIVHb5WDOpUg/Gp0DRLxHpSR7sWvBKh6obPQldrYh1Obj/brmg0vDvyVg4zeox/YEYLOKS8izEP4wi6qmpmFuAb7PbkkYLsEkCBT0IS7dZXmWlCWxx/9ssV4o1W9Bbydxugc+8LHDCOs4CHt34QSXzIo8loXBzOF3O2qF8C52G3mNjA7sSYyDLIsNgArVdKNUhIiVvEz+XAMIllGkhpzQwPnhBmwfoQ== 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=LCVmFFvX5WgYWFxyQVMW7XFYG/CCU9IE7aAPdxCjoTs=; b=R+gtkED9qQczN5fXUE33TxsG021B3XGnWWbdF1/qoDV6Or1hp6WUC11J/lhnRIXrqWlUUekBgUb6dkqoCoGaheVrrVS4g0imKDZ7NJXShV1pyOIr4UVSIL6XbPUeJyC2lqUVWug6NmlQmqo5217YiWlHHfOPMBUQmUtAreC95mdgQOyxVAiKQpWnH/CtjfsLEKP+wKplXkd7lo9J/1ixl0eqRoQqUJkC1Yr33PMAlpcDz2fjA7VdOH73gf/SVeKIa5LvgG+s7+k4yUYjC58Shq/tuCp1YRT80LVXVoKhOZ5k7rUsNkIANjKEa4ifT7vXwtH9C83MP83Nux1hNOHraw== 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=LCVmFFvX5WgYWFxyQVMW7XFYG/CCU9IE7aAPdxCjoTs=; b=jX9rdZsVG6LnTCVyKN3KfmMJpJ49Wvy0imzD4d5YNWN7ipgqCgI74iBT2jEI7LOYg0+1UfqSQvFFdZSdNGikc/NKSd/zpogNBcFIFL6GY8n5O8oov8Oq37W4OopojxPvZHkDSIV06+2zz3FA+/NqmButzOz8Uy2CGMiEeyZfvfSPblMtibcoAKGEnejfT25atbKq2H6J2NFyh4RHGnhFQfn/fIJCnZwRAAt/A+LKZwUdvTgPtEF0iM7mGXSJeXs9C2EmfHVhBlgMHGsLcCRIJHSruslpdXIDmgJbrXu3Zi+GVHsh9Ncu/EEcOEgTC60SnWDSMXpK27y9kEJphJ/Wfg== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB2898.eurprd09.prod.outlook.com (2603:10a6:208:132::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16; Mon, 20 Sep 2021 20:52:52 +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.4523.018; Mon, 20 Sep 2021 20:52:52 +0000 In-Reply-To: <92c5ea92-accc-5bb8-4063-e37b79fcd264@yandex.ru> (Dmitry Gutov's message of "Mon, 20 Sep 2021 15:49:43 +0300") X-TMN: [iEEYmI8HIiBDxUWewy0o1BjlZ9E09SZl] X-ClientProxiedBy: AS8P251CA0005.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:2f2::10) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87mto7otp8.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AS8P251CA0005.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:2f2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Mon, 20 Sep 2021 20:52:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7e3a5fd-1470-4729-f7f4-08d97c789cbc X-MS-TrafficTypeDiagnostic: AM0PR09MB2898: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RdPaGgFnRaNzTI7C0QruXH0zmINRfeSiSD1W6L3mTIxlLPUMlI0J0dsOrr1wy5DU3uV7RVEPa1cO7b72dsvkEHdkzF/o7nXa/awAGuzdiUUl4AJL5G2Dw2qA2RynTnIoWRCsNre+L82p20C0JgPLgvwbD9zvHrwrMTclN5wx6fEiAGFnsVcIVXmJ281OzAHTc+A2nPDxOKJa5IIhjTZW1meccqf5PtAQALMgYtBTGUm44W9pw6PU4uZ2IvlNmWnaWvWEG5tWhH9acSxHqiPGbzRBPKh9sURGV6TbUvj6VJMYU/oJPWG4MnMqlu5EuXqJoDqHH+2LGRpvTEb0a2w5dT2BszfuSVI+Vo+JtxKhZg1dZjCpljEtnCEawSVf1Ic7kLHoOt/FAuYNdPvyX0Yx7Wen56JQssEkBtrUn2r6ZfG7ifxTaHP19hqsGIfLwejK X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 89rf5x76Caacasz0WVuYEpDRlXcvQtrpIDJvq/UkiDrQ2S+keThmmaA/PqQhEJeJhIoZntc4MU+EjuNQAIXQersybROlEwVuOl85DfnarZM/YAiQe26cEZbinn+zrhcWFDM/IYGIXmfgAAy1ZK3+8Q== X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-72e6e.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: f7e3a5fd-1470-4729-f7f4-08d97c789cbc X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2021 20:52:52.1516 (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: AM0PR09MB2898 Received-SPF: pass client-ip=2a01:111:f400:fe08::82e; envelope-from=arthur.miller@live.com; helo=EUR03-AM5-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, 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:275170 Archived-At: Dmitry Gutov writes: > 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. 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. >>> 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. >> 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.