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, 10 Mar 2023 23:55:24 +0200 Message-ID: References: <1587ddb6-f631-0890-965a-c7acb5729fa6@yandex.ru> 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="16975"; 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: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= , Helmut Eller To: Ergus , emacs-devel@gnu.org, John Yates Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 10 22:56:14 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 1pakik-0004AK-0t for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Mar 2023 22:56:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paki3-00086y-PM; Fri, 10 Mar 2023 16:55:31 -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 1paki2-00086l-Dr for emacs-devel@gnu.org; Fri, 10 Mar 2023 16:55:30 -0500 Original-Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1paki0-0008F8-DJ for emacs-devel@gnu.org; Fri, 10 Mar 2023 16:55:30 -0500 Original-Received: by mail-wm1-x32d.google.com with SMTP id fm20-20020a05600c0c1400b003ead37e6588so7077720wmb.5 for ; Fri, 10 Mar 2023 13:55:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678485326; 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=VzElW/n3lsb2SwUw4TmQW5UqPi9FdGYjYYoTNOvkblQ=; b=V71f2v3/IQBHGgt83iaSO782OMiXI+2W5w/chj6o+vcdgTCO9j9cEJbautGbjkRrVh vePJn+OrkBeWi05weXnWor2NCnjAOYOQJm809uswss/nTpmRbaYcERgG7o+IKNvEWXhZ bA0FoEfg8BI8DRCIs/plUxebqbjom2ZFc+5YcVEBegIhnjnAK4GunwyBy1Bp6OUHR+f0 eWxzof9cYQiuzncVtL55VNIqCG1+tgCACu00YvX84zT1WCAAquW5f4P+t5Wa/Gi+YKD1 EHonmtthkCrsLJk4IESA4sy3315k0evTg6heu76qcbeuyNCLB8Pie32mNOI9S3zSaD9R Oqxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678485326; 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=VzElW/n3lsb2SwUw4TmQW5UqPi9FdGYjYYoTNOvkblQ=; b=aP122++ggmTRie/H15wh8SbpX5BcYgn8ZJG4vDEC7WKkItGzfwqAxUGA5ycH+qnFd5 WFLdBHM0zJ/zQjktwuO2SaS0w93aE76EDvtyzvd86aZAlwylDODr478inB+l0G4t3/0O rllbI5Bx6V/uZv6CEBOxxQeutgtGvPALNhFOWMnyl8iEO7ctbzJJpwbZAAVgdVlwyeID yOBuuI5dOkBrwOP+QibDqsXX/NeceFZy1fZxYVjKpGdu4BpWrIJHQT+zhoXXGMtPPNK1 BtTV3njbgvpu/DNSomlDooesJxtc6mYEE4/xyWfg1egB+9f/XVW2zMm7sFeLtn4ts2L0 9ETw== X-Gm-Message-State: AO0yUKU9J2AX40dBqPEYg8rx75rqATCVisooHiDsNodHXR7z0PH5Lpbg xuQ/Irh3ytqAVAabMeX2PHA= X-Google-Smtp-Source: AK7set9WG6GUWrmAeCbI/Sax0MEFpbE6xZ9fxZSPvol5HtSf1Px7vqp9jOAgRjyGClUU/gNdHwwIvQ== X-Received: by 2002:a05:600c:4f13:b0:3eb:399f:6b70 with SMTP id l19-20020a05600c4f1300b003eb399f6b70mr4382583wmq.31.1678485326261; Fri, 10 Mar 2023 13:55:26 -0800 (PST) Original-Received: from [192.168.0.2] ([85.132.229.92]) by smtp.googlemail.com with ESMTPSA id z17-20020a5d4c91000000b002c5a1bd5280sm738777wrs.95.2023.03.10.13.55.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Mar 2023 13:55:25 -0800 (PST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=raaahh@gmail.com; helo=mail-wm1-x32d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 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.001, 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:304260 Archived-At: On 10/03/2023 02:57, Ergus wrote: > Ho Dmitry and Joao > > On March 6, 2023 3:09:40 PM GMT+01:00, Dmitry Gutov wrote: >> On 06/03/2023 01:40, John Yates wrote: >>> For languages that do not distinguish declaration from definition, >>> another alternative is to have both key bindings reference the same >>> find-definition functionality. > > Yes please, just fall back to find-definition (or find-references) + a warning when find-declaration or the the others are not supported? It is simpler and practical. Could you explain this usage scenario? Why not just report "unsupported" and let the user try again with the simpler key binding (M-.)? It's not like people will prefer to reach for C-M-?, or will hit it by accident. > Alternatively there could be a default fallback command similar to find-references but reordering to list definitions first (just an example) That sounds harder because at the moment our "reference" items don't have indication of which type they are. So if we wanted this to work well, we'd have to mandate that additional information, and we don't have any good implementation options for either etags or elisp backend that would do that. >> I think I would generally prefer for the "find declarations" binding to end with an error when unsupported rather than repeat an existing command which is already accessible through an easier key binding. >> >> Otherwise some users might waste time wondering over the difference, testing, and comparing -- I myself would, probably. >> > > Before binding to a key maybe let's start again with the simpler: to add them in the right click context menu... And we can find a binding later. We can do both.