From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Adding support for xref jumping to headers/interfaces Date: Tue, 7 Mar 2023 12:44:03 -0800 Message-ID: <1919900F-4D2C-43F6-8D01-9BA645D34A9B@gmail.com> References: <1587ddb6-f631-0890-965a-c7acb5729fa6@yandex.ru> <87r0u2ax26.fsf@betli.tmit.bme.hu> <253cdcdd-863e-e8e3-a783-62ce1c570cfb@yandex.ru> <87wn3s9vux.fsf@betli.tmit.bme.hu> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28365"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , John Yates , Helmut Eller , emacs-devel To: Felician Nemeth Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 07 21:45:08 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 1pZeBI-0007CG-7l for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Mar 2023 21:45:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZeAX-00014i-4h; Tue, 07 Mar 2023 15:44:22 -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 1pZeAV-00013Q-Vq for emacs-devel@gnu.org; Tue, 07 Mar 2023 15:44:19 -0500 Original-Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZeAU-0005XG-6r for emacs-devel@gnu.org; Tue, 07 Mar 2023 15:44:19 -0500 Original-Received: by mail-pl1-x636.google.com with SMTP id x11so10941835pln.12 for ; Tue, 07 Mar 2023 12:44:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678221856; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LiKK5xb2mkFDxmAJrcOQWQtm8a06rE7Q+8AX0lpMrbo=; b=cOnKttxaJAKfPBjYPGIypgCPUcF1E+7uaHze+AkoNi9YIt60xl/ApA05Jc0D4/2K9c wSD9VEf//G/gdOQG0mGDHwtUWKM2Wb/sjQa5G97kL5+7ZKkT616IMmThyzpxc4S/Z9jk WkeJSVCEjZb+pum2qmpX+Z3rNuGWmYWzR7ZDVu6+jaIouh+WPPARybP8POZJDM6rWbGh Z8TndgeZFUAkMiGw7YTE4EeiG6hJiTYS2kMifbJenDPB/H5xD1v1fk+9qnMik7+KTDFS +D0/Z1iLL+J3IKn26z/fk7yeDK1ff0VufxhNxwt13sDBmwL3A3aPgl5eFEnXaEk3yU4w 0NrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678221856; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LiKK5xb2mkFDxmAJrcOQWQtm8a06rE7Q+8AX0lpMrbo=; b=BlV2vTk7NFXDG27QCOqbjGYMA5JCOVqdE2PS+81JM8qsUmGW3+OuqkRJroqVmiECnb ZGG1/m+DZE+D7B/BM+LZBCg0bxMCxU4f71zlOSRSoTK+HB/PeuEaBfZGFQy6+T7rlyOm ZoP1G4QZ8vjIQfgOPai+Ggz4NwAT15mvl5VOE9sIVOXjLDFXGMZz7FOL8XZ19UdFh0PK 5Md8U0iHhBI+H3aAwIYJlOlOzkq0vSPk2vtS0a4yeRyNn2frth3/6Up7FQeVY5nGI1j1 0Fym7S0vFIkmWstEE+B2g5yEuNpLftw5N02fHIFHP+fQQnOe3z4/fp2cb2Q5fk7X6cMx iI4w== X-Gm-Message-State: AO0yUKU2t5C8qRjeG9zJONKCUCxf3KpWYlzqSpsa3Zm5zzQyOFPrDKX3 32NUqafya5/S3OeXWtRV/G8= X-Google-Smtp-Source: AK7set9jeveFzPuJoGdOHdlW5fchDwz4P9RmCt3r/sCxLmEXBnjuriD83mdohSffvYI1DnAb3zlN/Q== X-Received: by 2002:a17:902:a70a:b0:19d:1898:5b89 with SMTP id w10-20020a170902a70a00b0019d18985b89mr12702990plq.7.1678221856648; Tue, 07 Mar 2023 12:44:16 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id le3-20020a170902fb0300b0019edf582a95sm1710731plb.20.2023.03.07.12.44.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Mar 2023 12:44:16 -0800 (PST) In-Reply-To: <87wn3s9vux.fsf@betli.tmit.bme.hu> X-Mailer: Apple Mail (2.3731.400.51.1.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=casouri@gmail.com; helo=mail-pl1-x636.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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.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:304093 Archived-At: > On Mar 7, 2023, at 11:58 AM, Felician Nemeth = wrote: >=20 > Yuan Fu writes: >=20 >>> There's also the issue of assigning keys to them (for tmm-menubar >>> alike interface), which might be harder to do automatically. >>>=20 >>> We could just do completing-read, but that's bound to be slower to = work with. >>>=20 >>=20 >> I like the idea of xref-find-extra. For keys we can support both >> auto-compute (use first character) and backend-chosen keys, similar = to >> read-multiple-choice. We can even allow users to customize it. >=20 > I think this approach might be problematic if the major-mode provides = a > "declaration" type and, say, Eglot provides a "definition" type. But > maybe, as you write, providing customization options to the users is a > simple solution in this rare case. We can provide a standard set of names & keys for common types and = describe them in the docstring and manual, and ask major modes to follow = it to their best effort. This way the common ones should be more or less = consistent, and major modes are free to add specialized types. >=20 >> Completing-read is a bad idea, as you said, it=E2=80=99s going to be = slow, >> much slower and less pleasant to use. >=20 > Currently all I write are emails, but long ago I wrote a simple, > tmm-based completing-read function to overcome this problem. Maybe = that > approach is useful here as well: > https://github.com/nemethf/single-key-completion/ >=20 Very cool! I=E2=80=99ve been thinking about a =E2=80=9Creduced M-x=E2=80=9D= that only shows a selected subset of the command that I use regularly, = and use fast keys to pick candidates. This seems to fit that purpose. Yuan=