From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Donovan via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71435: interactive xref-find-definitions-at-mouse Date: Mon, 10 Jun 2024 10:39:04 -0400 Message-ID: References: <86y17fbdkw.fsf@gnu.org> <87jzix1g4r.fsf@posteo.net> <865xuh2tpk.fsf@mail.linkov.net> <87frtl1djg.fsf@posteo.net> Reply-To: Alan Donovan Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000017abd0061a8a1dae" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26948"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 71435@debbugs.gnu.org, Stefan Kangas , Juri Linkov To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 10 17:06:17 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sGgbA-0006gP-Kb for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Jun 2024 17:06:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGgag-0004ni-PB; Mon, 10 Jun 2024 11:05:46 -0400 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 1sGgaf-0004nQ-Di for bug-gnu-emacs@gnu.org; Mon, 10 Jun 2024 11:05:45 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGgaf-0005zQ-67 for bug-gnu-emacs@gnu.org; Mon, 10 Jun 2024 11:05:45 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sGgav-0003He-Q7 for bug-gnu-emacs@gnu.org; Mon, 10 Jun 2024 11:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Donovan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jun 2024 15:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71435 X-GNU-PR-Package: emacs Original-Received: via spool by 71435-submit@debbugs.gnu.org id=B71435.171803196012613 (code B ref 71435); Mon, 10 Jun 2024 15:06:01 +0000 Original-Received: (at 71435) by debbugs.gnu.org; 10 Jun 2024 15:06:00 +0000 Original-Received: from localhost ([127.0.0.1]:40382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGgat-0003HK-QP for submit@debbugs.gnu.org; Mon, 10 Jun 2024 11:06:00 -0400 Original-Received: from mail-qt1-f174.google.com ([209.85.160.174]:37196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGgaq-0003Gt-TH for 71435@debbugs.gnu.org; Mon, 10 Jun 2024 11:05:58 -0400 Original-Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-4405cf01a7fso484321cf.1 for <71435@debbugs.gnu.org>; Mon, 10 Jun 2024 08:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718031874; x=1718636674; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=m5JGsCb6gYhz7/q4oiuWZyIq9Y7R0EipfGif7e0PLA0=; b=UQZH0dhkY5+eKAllf2WFG6DdTg/cEIdtL+1xithut9zblU2ibNfNSFmtJ6xmg3qecE aIQir9c0DI21FP3PMuKK4ca862n3xrnCfPb8U2M0VGGwoCveYGECfU6ZygTgVMNsURNu R8Rk8VIbVoCgZaHbvXULygQYn76/Y7UDv9OUoLxvA3gRVAZ97dWLlqnpqPhdc/Y5RVFb RYdRbMGiLqz1jwg25yXG+glcAGcNQSOekyE/N+pO8EDAfsWX8e0q4g0qTCzrDPXGHkNW 3IkpP+ADdgesiJywU3561S7gBK7hFIP4Gl1PiuKlNrz+k5LrZUuxVwA8R7NNqbA658CJ YiZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718031874; x=1718636674; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=m5JGsCb6gYhz7/q4oiuWZyIq9Y7R0EipfGif7e0PLA0=; b=CxLgJ0CphZ0mpOHOO0Jhsjm+HaDd52o2C3IHQ15k9salJqY7HWK5zPF/LzkWopd6Li rR3RZvmgNs9h4suiAT9RqPuNOMGX1YoujcKikLHYHXQxh5/iwkIVQd+YivL5mPvqo3kF UUkEtkIWR3AXwd+B6JclZh2ckNvwnquzYE0+AzcwT8Wf875ulbo/aV4MUltj6+N1zY+w OS2VL0LVuPHC3KCkfo8WJ+fnFIIsqExnXKLh4+GcyKVt5pz3YwikTOlTr0kfZ+u4Tl0K lXemr4GxcgfvKmA/LxxEiHht0o8jE5/ak1g7h9OzB/myXnm/o36ZiPNcbqu9GoIq3ULB pRSw== X-Forwarded-Encrypted: i=1; AJvYcCXEBMeglUkhAhYfEPNn7YpB+6Gxm+4LD6NeV/oIReesKzYp5sGW1PDDOeF56N/D+IOqLP9YJ759p/P8RCaMwO55No18UDk= X-Gm-Message-State: AOJu0Ywuwej6KfL2T2qQf1O0Dzb138nAudA+/KPTORjE8zlEXDC1FIMn mNctc3BbqArDRHWKyKabUdc4Ub+dNHABqEbxqbZz4/44BCf6E2dJNzy2Lcjiw5U/9d6IC0Yza4B BQm+7MIzSy/q+xVaGps0774+TseJchshoOEq6r5mnxEV3vpRwYzyC X-Google-Smtp-Source: AGHT+IHOL34FeZJCrSYgAdThTzmd53ox7C6F0B6BRvP3ePhMKzcfIrkoxx7rGBqFqdpJJ25iCzbAShlxW6MZ/orykNk= X-Received: by 2002:a17:902:8bcb:b0:1f6:b033:a4e with SMTP id d9443c01a7336-1f6ef27af47mr5109155ad.4.1718030356129; Mon, 10 Jun 2024 07:39:16 -0700 (PDT) In-Reply-To: <87frtl1djg.fsf@posteo.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287034 Archived-At: --00000000000017abd0061a8a1dae Content-Type: text/plain; charset="UTF-8" > ?? This works for me: > (global-set-key [C-down-mouse-1] 'xref-find-definitions-at-mouse) Ah, I remember the problem now: if the point is at position A and the mouse click occurs at some unrelated position B, plain old xref-find-definitions-at-mouse will use position A as the basis of the query, which is most surprising: it might be a non-identifier, in which case you get an error, or it might be an unrelated identifier, in which case you navigate to the wrong place. So perhaps my request should instead have been expressed as a bug report: xref-find-definitions-at-mouse uses the point instead of the mouse event position. On Mon, 10 Jun 2024 at 03:07, Philip Kaludercic wrote: > Juri Linkov writes: > > >>>>> Many editors allow a mouse-click operation on an identifier, plus a > suitable modifier key, to jump to the > >>>>> declaration of the symbol. Emacs provides > xref-find-definitions-at-mouse, but I couldn't find a way to make it > >>>>> work in response to a click. > >>>> > >>>> ??? This works for me: > >>>> > >>>> (global-set-key [C-down-mouse-1] 'xref-find-definitions-at-mouse) > >>> > >>> Should we consider adding such a key binding by default? > >>> > >>> Is that a feature that users want? > >> > >> Perhaps one could add a global minor mode and mention it in the menu > bar? > > > > I'd rather enable context-menu-mode by default. > > If that is up to the discussion, I'd vote for that as well! > > -- > Philip Kaludercic on peregrine > --00000000000017abd0061a8a1dae Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> ?? This works for me= :
>=C2=A0=C2=A0(global-set-key [C-down-mouse-1] 'xref-find-definitions-at= -mouse)

Ah, I remember the problem now: if the point is at position = A and the mouse click occurs at some unrelated position B, plain old=C2=A0<= span style=3D"color:rgb(0,0,0)">xref-find-definitions-at-mouse will use position A as the basis of the query, = which=C2=A0is most surprising: it might be a non-identifier, in which=C2=A0= case you get an error, or it might be an unrelated identifier, in which cas= e you navigate to the wrong place.

So per= haps my request should instead have been expressed as a bug report:=C2=A0xref-find-definitions-at-mous<= span style=3D"color:rgb(0,0,0)">e uses the point instead of the mouse event= position.





On Mon, 10 Jun 2024 at 03:07, Philip Kaludercic <philipk@posteo.net> wrote:
Juri Linkov <juri@linkov.net> writes:

>>>>> Many editors allow a mouse-click operation on an ident= ifier, plus a suitable modifier key, to jump to the
>>>>> declaration of the symbol. Emacs provides xref-find-de= finitions-at-mouse, but I couldn't find a way to make it
>>>>> work in response to a click.
>>>>
>>>> ??? This works for me:
>>>>
>>>>=C2=A0 =C2=A0(global-set-key [C-down-mouse-1] 'xref-fin= d-definitions-at-mouse)
>>>
>>> Should we consider adding such a key binding by default?
>>>
>>> Is that a feature that users want?
>>
>> Perhaps one could add a global minor mode and mention it in the me= nu bar?
>
> I'd rather enable context-menu-mode by default.

If that is up to the discussion, I'd vote for that as well!

--
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Philip Kaludercic on peregrine
--00000000000017abd0061a8a1dae--