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: Adding support for xref jumping to headers/interfaces Date: Fri, 24 Feb 2023 23:29:40 +0200 Message-ID: References: <83bklin83z.fsf@gnu.org> 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="15317"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Cc: emacs-devel@gnu.org, azeng@janestreet.com To: Eli Zaretskii , Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 24 22:30:40 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 1pVfeK-0003md-8V for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Feb 2023 22:30:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVfdX-0007uX-I2; Fri, 24 Feb 2023 16:29:51 -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 1pVfdT-0007uN-E7 for emacs-devel@gnu.org; Fri, 24 Feb 2023 16:29:47 -0500 Original-Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVfdR-0005TC-IZ; Fri, 24 Feb 2023 16:29:47 -0500 Original-Received: by mail-ed1-x52c.google.com with SMTP id ck15so2841378edb.0; Fri, 24 Feb 2023 13:29:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=aKCk2ic38eUzLHwCGtiMcJuyphGcfZj/KX6+oUrZalM=; b=qNtUuWHH0vrDgBEIFTzz60++yr6M7LpIzTMK0VwWUg6wV1BjZQDeNQdiw4q3QdruNr bcf5VnihUVzbbi2Rm+dQr37UIznGASdbbK9r86KXqRMaILTSruSeItlfpF+RZO/eRh41 o7/XOvGk4l6zkrtykW6AaOhbtZCBQRebVOiWVUdap8GK9ABQpkZqV43td2O13iBpXNJh amb8owyLWdH9oIOCnDUi6psB84O30nknoswx/RcbQYfOwL1W/9JYcN1V9decsahxvc4w j/Wcf7M7CngWmQ4vVcOZzvfvPlaqV+ZtLsGycdHArFquvNE0CG+KJJZN5L8fSUcX3TMc xGNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aKCk2ic38eUzLHwCGtiMcJuyphGcfZj/KX6+oUrZalM=; b=S7dCCZma9RC/kiUDOATb5uPmhT+eWNuoz0k10/dFFuCYAXRAH9/ZHwEiY8GVoYQS55 qDuzQX9zIYg/Cdh5024GO6w3s4bc6frA3Pnm6K61boFFDcBvqkZ8tC7lSB2LLSBnJj1G 97VwvHBUfMOpKoEK2kdaQRnthWa9uKNE5jE8Wl6NGbaa4P4GOa9/0OnNWRO9KgV6rBlQ 1AGCiiE3mFZunrFyhL/rxlzSGThwXI2zr4Fb2SmsZyF65tCVxlumQuJC+GMomML1b67j RsBTLjMtH7qStTt770PQ9kK5d+Cp5QevZzuv9fnGdJ3zcX/aPPn5dkMEio9gEpNyOhT9 Ms/Q== X-Gm-Message-State: AO0yUKXPT2nHXHiTN1uuc3zPjQOS77muoXFPWeTGP1bRR4Vxx5lVV0cy 13AelmpEjBefOaiBrflY19peolAz3vA= X-Google-Smtp-Source: AK7set+ws4xSC/pD0e7ql2e+XHJEsCex4ntpVhXPm1NUEbgK8rV6VbjnJUbY4pULxT/lxA6xKgUETw== X-Received: by 2002:aa7:d84e:0:b0:4ad:7c30:2599 with SMTP id f14-20020aa7d84e000000b004ad7c302599mr16542448eds.13.1677274183187; Fri, 24 Feb 2023 13:29:43 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id s24-20020a50ab18000000b004af6b93f00asm176160edc.23.2023.02.24.13.29.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Feb 2023 13:29:42 -0800 (PST) Content-Language: en-US In-Reply-To: <83bklin83z.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=raaahh@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.094, 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.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:303775 Archived-At: On 24/02/2023 22:04, Eli Zaretskii wrote: >> From: Spencer Baugh >> Cc:azeng@janestreet.com >> Date: Fri, 24 Feb 2023 14:56:59 -0500 >> >> >> xref provides support for jump-to-definition, but no support for >> jump-to-interface. The latter would jump to the header or interface >> file for an identifier. This functionality exists in some packages >> already because it is particularly important in some languages, and I'm >> looking for suggestions on how to expose it through xref. >> >> For example, merlin, for OCaml, supports both jump-to-definition and >> jump-to-interface. However, merlin's xref support only exposes >> jump-to-definition (through xref-find-definitions), because there's no >> natural way to expose jump-to-interface through xref. >> >> It would be straightforward to extend xref with a new command >> xref-find-interfaces. The main difficulty is picking a good UI to >> expose this command. I've thought of a few options, but nothing that >> seems obviously correct, so I welcome opinions. >> >> Suppose there's a new command xref-find-interfaces. Then some options are: >> >> 1. xref-find-interfaces could be bound by default with some new binding. >> I'm not sure what a good binding would be. >> >> 2. xref-find-definitions could call xref-find-interfaces if called with >> a prefix argument. Note that this would change the current prefix >> argument behavior of xref-find-definitions. >> >> 3. xref-find-definitions could call xref-find-interfaces if called after >> some custom prefix is typed, like how other-window-prefix works. >> >> 4. xref-find-definitions could call xref-find-interfaces if a certain >> customization variable is set. >> >> 5. Like option 5, but there could also be a new binding to >> toggle that variable on and off. >> >> I think the most satisfying of these is option 3, but maybe that's too >> unusual of an interface for core Emacs? > I think 1 is the best alternative. C-M-? is available, AFAIK. Option 1 sounds best to me too. About the name, though -- does "jump to interfaces" make sense for many languages? To my ear, the naming seems specific to OCaml. "jump to declaration(s)", perhaps?