From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.devel Subject: Re: Adding support for xref jumping to headers/interfaces Date: Thu, 09 Nov 2023 12:07:00 -0500 Message-ID: References: <4639d7ca-2109-864c-33c0-38e65f26f262@yandex.ru> <835ybb3txt.fsf@gnu.org> <83wn3q311i.fsf@gnu.org> <412afa2d-5dbc-52da-39c4-99be3873929c@yandex.ru> <83o7p20wdi.fsf@gnu.org> <72b09256-5a1b-8962-9e3c-7d2ffd0dc0d7@yandex.ru> <83ilf925n8.fsf@gnu.org> <95afa441-18ae-e62a-be16-be73a545bbba@yandex.ru> <65a16247-1b1a-149c-b413-71612f88f184@yandex.ru> <9377bf2b-13ed-8d86-4294-0b88e6808d80@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25945"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:pDFo7ZZe7TszaTJwpB5DdJegM+A= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 09 20:24:22 2023 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 1r1Ada-0006Vw-6Q for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Nov 2023 20:24:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1AcQ-0000hZ-IO; Thu, 09 Nov 2023 14:23:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r18Uq-0007ym-If for emacs-devel@gnu.org; Thu, 09 Nov 2023 12:07:12 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r18Uo-0005vo-V7 for emacs-devel@gnu.org; Thu, 09 Nov 2023 12:07:12 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1r18Un-00065O-1v for emacs-devel@gnu.org; Thu, 09 Nov 2023 18:07:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 09 Nov 2023 14:23:08 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312437 Archived-At: João Távora writes: > On Wed, Nov 8, 2023 at 5:45 PM Spencer Baugh wrote: >> João Távora writes: >> > On Wed, Nov 8, 2023, 16:40 Spencer Baugh wrote: >> > I found it rather clumsy out of the box. >> > >> > What exactly is clumsy? Please state the command you used and what the clumsy effects were. >> >> Specifically xref-find-extras is clumsy, because it's annoying to have >> to type the full "kind" in to request a specific "kind" of definition. > > I don't find it annoying. But since we settled long ago that there can > be no standard set of all kinds that makes sense for all languages, then > I don't see a better way than what the current xref patch does now: asking > the backend for kinds and then having one command with an additional selection > step. The little change I did to Dmitry's xref.el allows particular modes > such as Eglot to implement their own "quick-access" commands for a particular > kind more easily. Here is the better way: have both a standard set of kinds, and the ability for a given backend to make their own custom kinds. A "standard set of kinds" would just be standard kind symbols. Instead of Eglot returning 'eglot--xref-declaration as a supported kind, it would return 'declaration. And we could have a standard command with a standard binding which requests definitions of kind 'declaration. The only change to the current patch would be changing 'eglot--xref-declaration to 'declaration, and adding an xref-find-declaration. Custom kinds would still require you to type in the kind symbol. (Or a backend or mode can make a "quick-access" command specific to that kind, if they want.)