From unknown Fri Jun 20 07:14:21 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#71435 <71435@debbugs.gnu.org> To: bug#71435 <71435@debbugs.gnu.org> Subject: Status: interactive xref-find-definitions-at-mouse Reply-To: bug#71435 <71435@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:14:21 +0000 retitle 71435 interactive xref-find-definitions-at-mouse reassign 71435 emacs submitter 71435 Alan Donovan severity 71435 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 08 11:31:17 2024 Received: (at submit) by debbugs.gnu.org; 8 Jun 2024 15:31:18 +0000 Received: from localhost ([127.0.0.1]:39239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFy2H-0000xw-KW for submit@debbugs.gnu.org; Sat, 08 Jun 2024 11:31:17 -0400 Received: from lists.gnu.org ([209.51.188.17]:44214) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFy2F-0000xo-EJ for submit@debbugs.gnu.org; Sat, 08 Jun 2024 11:31:15 -0400 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 1sFxzt-00009M-FF for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 11:28:49 -0400 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sFxzr-0008Gj-RF for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 11:28:49 -0400 Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-374991c4aa1so120595ab.0 for ; Sat, 08 Jun 2024 08:28:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717860525; x=1718465325; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Be2NT5t0r5ZMzWO81yuswqYlILf0ZzmYzi6WZYSsTtw=; b=HMkt+dg1w8MIlM+qxnrozaYqEH64KL99LUIzZie9cD3U+X+mEpcIBlujRqqWxGV5zc oZQ+V5I7I8StIqOOgXvfRUtJhwmwvO95xxfwRunmTGxbsiN4GZMN/WNq+IOHZpFO5usK eoJdQaPRR/SG76TR2uo7jjTkPf/C1ZhyxoH/hMjOz4MUxVj+1QPX6VJCig10fWJEz7D4 4Ym0HC5IQ4WAksPPDv0QEAfkBg7F07M2Kd6fZ7YbKXNpDp1aX2pNsJu86wKOWAgH92z/ z6VDSU84VXyINub8iac9ylCxb2mRMhkOG7jdoqQHgLK3DqeQ+SIZoUIpaiDzNOAPkeZS 2Vhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717860525; x=1718465325; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Be2NT5t0r5ZMzWO81yuswqYlILf0ZzmYzi6WZYSsTtw=; b=LRwIsS1codOLaq4UaZHUVDzcxNVUEP9bm/pYZb30Jbn/tyEQ7YbhYUeB2bdgtB3xdh aU2zGpHQdi39dEH8kguC7V3umUI23qi7qDRZJMcyyWKisP5sezbqH3pIWWs7a4SGserw GTqOmps/OClTWbNXxj9PkEkrO+iTRH2H1UwJDPeNDnJyapwPuGUWA3RUoTBkgYtdwic0 vybaJmCg6Nm6cyy5GUm0eL5p7SOuySs3WiSUS3QB6n2QDFw4z+LUj9NIB39g06mEomJD 8y16If4g0EandpTgjVivfIj6L/SK3RTjyiBMceGahYPSPIk7iTXXmJjGE2kj9KM2EoWn 3Mvw== X-Gm-Message-State: AOJu0Yz8Bo66e5Y5AbIgo8yFd9koSo4oZKEbol/PvLTxsn17UmXyxaJs 8NVAr+2VdSxqyYvat1qt+g6HeAQtpdmNB7V4CH8McxEStohO7FXnEFlbG9abk+9vFgEjykucgYC WjXQWuOUesrmVSTkLAQ8+7/+AMz1zY8qN3F0v61SWxpu7KrhZhwnR X-Google-Smtp-Source: AGHT+IHCahnbUoA9MJ0cfS+kdeE8FIOkcsefDlP80EyADmSeVbbRjCSd/FIMVJddG6zjZupc3RtUpM3EvtV+Scaqr1g= X-Received: by 2002:a05:6e02:9b:b0:374:af1f:2bab with SMTP id e9e14a558f8ab-37594eda036mr1412075ab.13.1717860525156; Sat, 08 Jun 2024 08:28:45 -0700 (PDT) MIME-Version: 1.0 From: Alan Donovan Date: Sat, 8 Jun 2024 11:28:34 -0400 Message-ID: Subject: interactive xref-find-definitions-at-mouse To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="00000000000060e122061a629208" Received-SPF: pass client-ip=2607:f8b0:4864:20::12c; envelope-from=adonovan@google.com; helo=mail-il1-x12c.google.com X-Spam_score_int: -175 X-Spam_score: -17.6 X-Spam_bar: ----------------- X-Spam_report: (-17.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --00000000000060e122061a629208 Content-Type: text/plain; charset="UTF-8" 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. So I wrote this variant that works nicely for me. Notably, it is an (interactive) command, and it doesn't use save-excursion. (defun xref-find-definitions-at-mouse-2 (event) "Find the definition of identifier at or around mouse click. This command is intended to be bound to a mouse event." (interactive "e") (let ((identifier (progn (mouse-set-point event) (xref-backend-identifier-at-point (xref-find-backend))))) (if identifier (xref-find-definitions identifier) (user-error "No identifier here")))) ;; cmd-click -> jump to definition (global-set-key (kbd "s-") #'xref-find-definitions-at-mouse-2) Could this functionality (not necessarily this code) be added to Emacs's xref package? I am not enough of an Emacs expert to know whether I was simply "holding it wrong", so perhaps this is merely a documentation problem. thanks alan --00000000000060e122061a629208 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Many editors allow a mouse-click operation on an iden= tifier, plus a suitable modifier key, to jump to the declaration of the sym= bol. Emacs provides xref-find-definitions-at-mouse, but I couldn't find= a way to make it work in response to a click. So I wrote this variant that= works nicely for me. Notably, it is an (interactive) command, and it doesn= 't use save-excursion.

(defun xref-find-definitions= -at-mouse-2 (event)
=C2=A0 "Find the definition of identifier at or= around mouse click.
This command is intended to be bound to a mouse eve= nt."
=C2=A0 (interactive "e")
=C2=A0 (let ((identifier=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (progn
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(mouse-set-point event)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(xref-backend-identifier-at-point (xref-find-backend)))))
=C2= =A0 =C2=A0 (if identifier
=C2=A0 =C2=A0 =C2=A0 =C2=A0(xref-find-definiti= ons identifier)
=C2=A0 =C2=A0 =C2=A0 (user-error "No identifier her= e"))))

;; cmd-click -> jump to definition(global-set-key (kbd "s-<mouse-1>") #'xref-find-defini= tions-at-mouse-2)

Could this functionality (no= t necessarily this code) be added to Emacs's=C2=A0xref package? I am no= t enough of an Emacs expert=C2=A0to know whether I was simply "holding= it wrong", so perhaps this is merely a documentation problem.

thanks
alan
--00000000000060e122061a629208-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 08 12:32:24 2024 Received: (at 71435) by debbugs.gnu.org; 8 Jun 2024 16:32:24 +0000 Received: from localhost ([127.0.0.1]:39313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFyzQ-0002f7-0E for submit@debbugs.gnu.org; Sat, 08 Jun 2024 12:32:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFyzO-0002es-5n for 71435@debbugs.gnu.org; Sat, 08 Jun 2024 12:32:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFyz2-0002UP-Uv; Sat, 08 Jun 2024 12:32:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ftSpQIk6r0h2ldy6MKl70qs1XwFEkmnJKpL4LXPAroQ=; b=UGMTM7nyeN0r XPbN3lqEYWSxn2afzf6bQg0DhOHdvqE1NQy2mzxZF2UdEDgDvx8sfJGXmjYQYWIQT6wpUcaK6Poy1 gG05lKfQVyZFvmHs5l+ubSWZBi+oRx8dAsYZvoCfAr0+9MPR0J6jFREWcAzv+AAdEOPb/DPOtO9ss d4i5YQa43ePU4bXeZ6OgAl8Kqm75///sWUS5xe9uxNOyevxQ1/8SgR2ie/5taZ90ZDEFvsXtatGoT rQeaZD7vl81igF1KofSgs/JJ8kH5BXu6bi2jX7Rlbtb5hV2V21fmnI2clDoUj3aES3zip7+rZwxsV 2GAKZ1VyPsjuIWymF/Rl/Q==; Date: Sat, 08 Jun 2024 19:31:59 +0300 Message-Id: <86y17fbdkw.fsf@gnu.org> From: Eli Zaretskii To: Alan Donovan In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71435 Cc: 71435@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 8 Jun 2024 11:28:34 -0400 > From: Alan Donovan via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > 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) From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 09 14:02:23 2024 Received: (at submit) by debbugs.gnu.org; 9 Jun 2024 18:02:23 +0000 Received: from localhost ([127.0.0.1]:52221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGMs2-00048v-OC for submit@debbugs.gnu.org; Sun, 09 Jun 2024 14:02:23 -0400 Received: from lists.gnu.org ([209.51.188.17]:51260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGMs0-00048l-Pu for submit@debbugs.gnu.org; Sun, 09 Jun 2024 14:02:21 -0400 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 1sGLuE-0006Mw-KR for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2024 13:00:38 -0400 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGLuB-0001k0-FS for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2024 13:00:33 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 438CD1BF205; Sun, 9 Jun 2024 17:00:26 +0000 (UTC) From: Juri Linkov To: Alan Donovan via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse In-Reply-To: (Alan Donovan via's message of "Sat, 8 Jun 2024 11:28:34 -0400") Organization: LINKOV.NET References: Date: Sun, 09 Jun 2024 19:46:05 +0300 Message-ID: <861q56ksf0.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=2001:4b98:dc4:8::228; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: submit Cc: 71435@debbugs.gnu.org, Alan Donovan X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) > ;; cmd-click -> jump to definition > (global-set-key (kbd "s-") #'xref-find-definitions-at-mouse-2) > > Could this functionality (not necessarily this code) be added to Emacs's > xref package? I am not enough of an Emacs expert to know whether I was > simply "holding it wrong", so perhaps this is merely a documentation > problem. There is the "Find Definition" item in the context menu enabled by context-menu-mode. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 09 14:40:28 2024 Received: (at 71435) by debbugs.gnu.org; 9 Jun 2024 18:40:28 +0000 Received: from localhost ([127.0.0.1]:54172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGNSt-0000G9-JS for submit@debbugs.gnu.org; Sun, 09 Jun 2024 14:40:28 -0400 Received: from mail-lf1-f42.google.com ([209.85.167.42]:50210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGNK7-0008IO-MO for 71435@debbugs.gnu.org; Sun, 09 Jun 2024 14:31:26 -0400 Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-52c815e8e9eso1098808e87.0 for <71435@debbugs.gnu.org>; Sun, 09 Jun 2024 11:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717957800; x=1718562600; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=veVkYLK+HRmskHDjFq8AlbPuwaneB2fxAr2S/KkunZ0=; b=AYAx9x9ScT5pEwxye3V5UmYkxP+wXeMnaGQawkRCegU3HKUZuQm2wisl6OdUdqeyWr If+GCy+GnJGptDoQ1iM8ZaLttqmQH44NJRNUFIpkz7I8+CAp24lx/qfMkebGkVFbGcpX wqDfohlPDPftME560N6RirRl+XUsDZ33yr0MvGZUppCBdWsq4z2+mOXUPshx4vRqkPlE kETcj0dZLp4uqUQgt9kpWVe+AaMwSEJHA1zM68t994zwSPSU0LnrKG5z50JZnv7mMnh7 dDxCesdt0HJE9uBy2oDnvbeJQ3aY+ClwhMazpDa4Uv03l126zC/nkn/ynKzZSR5WmnQT AZkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717957800; x=1718562600; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=veVkYLK+HRmskHDjFq8AlbPuwaneB2fxAr2S/KkunZ0=; b=RvRT52tjr0ODDBzksR8YtVdN2s2PlD7mRe1oHgpF+tvoXEQhMcSHYeUKC1N0wunjdZ k6e03gJKHMoK59IUR4jSYuaF/rrtAOCLwtDkK2+fHMYOYM8GcANXuq9mgTPP4193C0Nt LUJM/cLUqQda5fyOLucpVQs9HfWQu2xhYZB0uNKYPk8+D13+XduOx6wPq12sGWt56jZJ QuQuLPGyqqWdIcdSyDyUYO7IP9cMv+YOSWSrbO6fplSk9RVLd6e0UyJdrQFJZT3ql7vb UjR7iOkBzc/zW9cNXFV4OcxkJU4tvXp31RVOh1mn1NarOiQnJ6Cw4I9nf6XruB0TiHFs 6xwQ== X-Gm-Message-State: AOJu0YyTbdHCYq3h7NJKawmiMXDA5BveWAANuox6tdzILYf6DHs14f4C cHYBhFvqEpfU/dMfQ/KFbiJsE4C1BBnZFcqo1Unoj3/nn9C0ZL16M/VInSakGrzjreL/wX004En HBK+ItvgOktqcG+rjqP3p8CLejYA= X-Google-Smtp-Source: AGHT+IE48TrprDUr7mRE1ddim7bpPtEo26Ptntg0D12xoiUZz8LFkXFl53NK+X3Jnbb69nZ16YLiibig10AynZca1Pw= X-Received: by 2002:a05:6512:3e8:b0:516:d219:3779 with SMTP id 2adb3069b0e04-52bb9fe04c6mr4122741e87.58.1717957799531; Sun, 09 Jun 2024 11:29:59 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 9 Jun 2024 14:29:59 -0400 From: Stefan Kangas In-Reply-To: <86y17fbdkw.fsf@gnu.org> References: <86y17fbdkw.fsf@gnu.org> MIME-Version: 1.0 Date: Sun, 9 Jun 2024 14:29:59 -0400 Message-ID: Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse To: Eli Zaretskii , Alan Donovan Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71435 Cc: 71435@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> Date: Sat, 8 Jun 2024 11:28:34 -0400 >> From: Alan Donovan via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> 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? From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 09 19:59:54 2024 Received: (at 71435) by debbugs.gnu.org; 9 Jun 2024 23:59:54 +0000 Received: from localhost ([127.0.0.1]:41111 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGSS2-0006Y2-41 for submit@debbugs.gnu.org; Sun, 09 Jun 2024 19:59:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGSS0-0006XZ-9k for 71435@debbugs.gnu.org; Sun, 09 Jun 2024 19:59:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGNkH-0005Zg-4Z; Sun, 09 Jun 2024 14:58:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=4Di7ChIG4XExav6PNmh37RR9eTYWUScF+FBCmvXQT5U=; b=V2SfhXh2vri/ vN4HWHu3mQ0uM4G0GEnHDD0jDPbs99K//mrbqS0pFoOB4OnjLEeuf0VwTrqEeJHcKWYE6S7bf88Lc Ejt2iAOHTUI7A41duZ1qXHlf1xTpvmKAbPpsb5MxZgAA0LEfDBLONsN5ZnsNBmcYVTC+j1utE6ZZj Eo1hGS/NiNztK2qFJjiujmS0uoeYfXxQY1fn6m/ZrMigWBfCcKOLzaw1/5iacnzDIk2M4mtDCZI2U iIpHDF7YkLBBuab+3D3m8WcnEquPI6VIO3QIGS9BO9mfRAGhmZgui/16H5nStqfOKz2gYjNghK5ez +Y0AzawWTGOjOglLJc2YCw==; Date: Sun, 09 Jun 2024 21:58:21 +0300 Message-Id: <86ed969c4y.fsf@gnu.org> From: Eli Zaretskii To: Stefan Kangas In-Reply-To: (message from Stefan Kangas on Sun, 9 Jun 2024 14:29:59 -0400) Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse References: <86y17fbdkw.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71435 Cc: 71435@debbugs.gnu.org, adonovan@google.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Kangas > Date: Sun, 9 Jun 2024 14:29:59 -0400 > Cc: 71435@debbugs.gnu.org > > Eli Zaretskii writes: > > >> Date: Sat, 8 Jun 2024 11:28:34 -0400 > >> From: Alan Donovan via "Bug reports for GNU Emacs, > >> the Swiss army knife of text editors" > >> > >> 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? Not by default, IMO. Mouse-click potential for bindings is at premium (in particular, C-down-mouse-1 is already taken), so I think we should leave it up to the user to bind it (and most probably give up some existing binding). From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 10 02:19:16 2024 Received: (at 71435) by debbugs.gnu.org; 10 Jun 2024 06:19:16 +0000 Received: from localhost ([127.0.0.1]:36963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGYNA-0002g0-1A for submit@debbugs.gnu.org; Mon, 10 Jun 2024 02:19:16 -0400 Received: from mout02.posteo.de ([185.67.36.66]:47959) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGYN5-0002fb-TX for 71435@debbugs.gnu.org; Mon, 10 Jun 2024 02:19:14 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id BA76A240104 for <71435@debbugs.gnu.org>; Mon, 10 Jun 2024 08:11:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1717999893; bh=BhVIndkmbPF0wNbd5yH0YTR/83cHMCWSJG4wTQ4ESE4=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=Yza0QVsJzCCyYZpQAUHvY0M5rlT21A8MIZTwZjgaUIXEUMOxzRHkTA9eCypIydPPH KhPA0hWVhpLABIXTdkseBYYMVXfNsVH8/Jz7jiKE/no2dvZTfSEY8GoTCAE6opP5sV 01fVEsewWD3gmkNLtz8QYJ3JaukBwmHBWVMiat9iBI5SjiYOfM12KwWjliiV4lDy5Q Suh02oh/0lTFIJa4d1yKUA6HA8EuCQwqJIG94+jT6DEz89+bqs43FExsGayxuHl6tD NSQfvg92ON+fHd0/AGfFCYEGE9XN6748edxFF3I1uvR56zrQLWG9iNmp+V0g3eZXyX rqfKeipPXqmFA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VyLzT0qKsz9rxB; Mon, 10 Jun 2024 08:11:32 +0200 (CEST) From: Philip Kaludercic To: Stefan Kangas Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse In-Reply-To: (Stefan Kangas's message of "Sun, 9 Jun 2024 14:29:59 -0400") References: <86y17fbdkw.fsf@gnu.org> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Mon, 10 Jun 2024 06:11:32 +0000 Message-ID: <87jzix1g4r.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71435 Cc: Eli Zaretskii , 71435@debbugs.gnu.org, Alan Donovan X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Kangas writes: > Eli Zaretskii writes: > >>> Date: Sat, 8 Jun 2024 11:28:34 -0400 >>> From: Alan Donovan via "Bug reports for GNU Emacs, >>> the Swiss army knife of text editors" >>> >>> 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? -- Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 10 02:40:32 2024 Received: (at 71435) by debbugs.gnu.org; 10 Jun 2024 06:40:32 +0000 Received: from localhost ([127.0.0.1]:38041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGYhj-0003b1-GG for submit@debbugs.gnu.org; Mon, 10 Jun 2024 02:40:32 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:47115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGYb2-0003HO-I6 for 71435@debbugs.gnu.org; Mon, 10 Jun 2024 02:33:37 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id B3290E0005; Mon, 10 Jun 2024 06:33:12 +0000 (UTC) From: Juri Linkov To: Philip Kaludercic Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse In-Reply-To: <87jzix1g4r.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 10 Jun 2024 06:11:32 +0000") Organization: LINKOV.NET References: <86y17fbdkw.fsf@gnu.org> <87jzix1g4r.fsf@posteo.net> Date: Mon, 10 Jun 2024 09:32:55 +0300 Message-ID: <865xuh2tpk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71435 Cc: Eli Zaretskii , 71435@debbugs.gnu.org, Stefan Kangas , Alan Donovan X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>> 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 10 03:14:14 2024 Received: (at 71435) by debbugs.gnu.org; 10 Jun 2024 07:14:14 +0000 Received: from localhost ([127.0.0.1]:40140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGZEM-0005Ba-5b for submit@debbugs.gnu.org; Mon, 10 Jun 2024 03:14:14 -0400 Received: from mout02.posteo.de ([185.67.36.66]:40929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGZEJ-0005BG-TR for 71435@debbugs.gnu.org; Mon, 10 Jun 2024 03:14:13 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 49272240101 for <71435@debbugs.gnu.org>; Mon, 10 Jun 2024 09:07:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1718003253; bh=On2k86RAYEUgbwCEwmCdRmVUT4C1wGtwFR9jespS9s8=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=XZoKhkmxBuKuu44gmTq40N6bw857LqWVLUlUm3BWJxU69w8+GznGaudNTHUMzxpmN H/AAtE8Ui9fyoczHMJqyeWT/guj3gtvRDOc2S9FMtQik9jdqaJazm1VLtdqjW0QSg9 fGhYRhHqj4ijBfBW0O7k9SGxVWdohEO4/rVB6FoyyPjSKfN0nx94o8zuNl4vRiC+He eFfkst1PxVDWZvuCNwpNVtkwBBMFslHxW1nO0fxO1w1bIj6jh4W75kvGyurEcXnWLD u5QjaQ+aJ+oZLXhS03YtmtPw4miFlc2fWGHC9vG1aAOyej3wjyXWqQHRuF2PmWWN6b 6TYNgCizxmeNA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VyND40n4hz6tyH; Mon, 10 Jun 2024 09:07:32 +0200 (CEST) From: Philip Kaludercic To: Juri Linkov Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse In-Reply-To: <865xuh2tpk.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 10 Jun 2024 09:32:55 +0300") References: <86y17fbdkw.fsf@gnu.org> <87jzix1g4r.fsf@posteo.net> <865xuh2tpk.fsf@mail.linkov.net> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Mon, 10 Jun 2024 07:07:31 +0000 Message-ID: <87frtl1djg.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71435 Cc: Eli Zaretskii , 71435@debbugs.gnu.org, Stefan Kangas , Alan Donovan X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 10 11:06:00 2024 Received: (at 71435) by debbugs.gnu.org; 10 Jun 2024 15:06:00 +0000 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 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 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) MIME-Version: 1.0 References: <86y17fbdkw.fsf@gnu.org> <87jzix1g4r.fsf@posteo.net> <865xuh2tpk.fsf@mail.linkov.net> <87frtl1djg.fsf@posteo.net> In-Reply-To: <87frtl1djg.fsf@posteo.net> From: Alan Donovan Date: Mon, 10 Jun 2024 10:39:04 -0400 Message-ID: Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse To: Philip Kaludercic Content-Type: multipart/alternative; boundary="00000000000017abd0061a8a1dae" X-Spam-Score: -8.0 (--------) X-Debbugs-Envelope-To: 71435 Cc: Eli Zaretskii , 71435@debbugs.gnu.org, Stefan Kangas , Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -9.0 (---------) --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-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 10 11:24:03 2024 Received: (at 71435) by debbugs.gnu.org; 10 Jun 2024 15:24:03 +0000 Received: from localhost ([127.0.0.1]:41695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGgsM-00072Z-I3 for submit@debbugs.gnu.org; Mon, 10 Jun 2024 11:24:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGgsK-00071x-1X for 71435@debbugs.gnu.org; Mon, 10 Jun 2024 11:24:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGgrv-0001Ho-HE; Mon, 10 Jun 2024 11:23:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=rvm2hr1vvJL+H1nkjnTRagrJZcfAiwqWL22LMB9bq2k=; b=sHRsePb71f14 IcObIEMP9XElTrS0gmJfHBd2sBdaaTMfts9PSPnIrBIdTrT2mISiqgHViQXddUqsUSeU29X4Q7EvA 9Eb/zvOJgFo1MheDRqJtuh8XPmiPjeG+53Ml4UtJEARu8zNO1ZhNQ1SRByfP7/Snk9+yuHSAZNk3k 0sHy1mrG/x53sSrMHaLQRLN+tOvXM5ZGn5OIpaWyjTfTyzqAhzSpQ+zCQxfqFpNMZJRAn7voHyzet ruE7Xiij3mXz39GGPw4feG3397njlB5vP0Js8z+G3P7DaVpl1YqKcyw/10b1GqDFRf0SxIxByVspq 2MN49O2zGfFlkQDU6OqWOA==; Date: Mon, 10 Jun 2024 18:23:27 +0300 Message-Id: <86le3c95zk.fsf@gnu.org> From: Eli Zaretskii To: Alan Donovan In-Reply-To: (message from Alan Donovan on Mon, 10 Jun 2024 10:39:04 -0400) Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse References: <86y17fbdkw.fsf@gnu.org> <87jzix1g4r.fsf@posteo.net> <865xuh2tpk.fsf@mail.linkov.net> <87frtl1djg.fsf@posteo.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71435 Cc: philipk@posteo.net, 71435@debbugs.gnu.org, stefankangas@gmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Alan Donovan > Date: Mon, 10 Jun 2024 10:39:04 -0400 > Cc: Juri Linkov , Stefan Kangas , > Eli Zaretskii , 71435@debbugs.gnu.org > > > ?? 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 I cannot reproduce thus. I just tried, and the mouse click shows the definition of identifier at mouse click, not at point. > 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. Please show a recipe for reproducing this, and please also tell what version of Emacs are you using and on which platform. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 10 13:10:23 2024 Received: (at 71435) by debbugs.gnu.org; 10 Jun 2024 17:10:23 +0000 Received: from localhost ([127.0.0.1]:47332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGiXH-0006bG-AQ for submit@debbugs.gnu.org; Mon, 10 Jun 2024 13:10:23 -0400 Received: from mail-wm1-f48.google.com ([209.85.128.48]:61440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGiCQ-0005YE-FW for 71435@debbugs.gnu.org; Mon, 10 Jun 2024 12:48:50 -0400 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4218008c613so1598825e9.2 for <71435@debbugs.gnu.org>; Mon, 10 Jun 2024 09:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718038047; x=1718642847; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=MKQQqJ8ADbuocQakwJFjLoI4cpdDip0YJv+MaiOXx30=; b=Os1PXwOq4t8ibtSx74y5R36moo+1kc35RdFJ172UAg/VxEjwSuHojV9JTbRxSl0q4j 7tHogkJhGHNpRQQ/BK0pQFngf/myqy2tXlPl1B0ZSux2Nn7SB4VXx/7Jg2P7Gd96j896 yS6BeQEdyZ+EM4i+O5eQu3+HHPJHSohkMKh9Wrmfoj8R9j5WeRL88e49LZLEq6A2F3F6 DMuCzWEB1gU8KjUC0YHOzixvkix5tSFNhzXlSxNkeht5HfzK9lbTw/LsmzqaV5Rwu7NZ f+SugXXpZnTn7R4daG39+HJuZB51WY0w0QkSJKiI6DWiD6GFoAldDK5VuA3H/TL06lOI oBUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718038047; x=1718642847; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MKQQqJ8ADbuocQakwJFjLoI4cpdDip0YJv+MaiOXx30=; b=rtuifXSqDF0NN2OVQd6qsS6iYXhJw1neYWedhDBL4aql3lkMX+6W38Jzihsk1v10aA vgKbl4PN8lMJ67QqRymCcDlZqSRWZ2us6I/QoC6ci7PRCie7gu5LFb4UaWRLNyI6b3/g I9KYqPBYRHHIGUdEsfsm2q/zSJ/qvkUNEFg0bpLE8sHuvptdKtw8eUlEG0HYhKEbYzIf TQEhbD6TCTZ140oX6Szr58bPBl8uFXV3UwVB1mYTOHFzdWnMKnjNvXnyFIYCP5ouwdQt H1y5LEDmY1OmNab7fxMgNxLKinGijAPr6CjlRQE+XRJk6BbfpTBbpl9eBaXl1U+LF7cK CoiQ== X-Forwarded-Encrypted: i=1; AJvYcCVWYxQIRe7jj7Z0gkYVPUKdrQPnGxZa2ZYRDMZv00UFZCW3/MqPeRY9NxAn6QPzDiiV5WAsqXSjZXK4y4cShQgR0bPdMRE= X-Gm-Message-State: AOJu0YxaqXj9ZDHjs/NfxG9Rfnu6pyhFCr1fqwKBVcz615xY3bq80bcX mwVoeXoZr+spHRCBKV2HQCd97Kp5sUrSTYFnGPdPhmwBW8R+xdfilpFH10YEdoD0n67zL1rBZZO TgaqjKIPXF6iFuRidz1h/HZiMk0nNgNes X-Google-Smtp-Source: AGHT+IFVi9b7FgPQIVLW3Zjnac7dgB6wgu5nsfk5zcJDYGUMs694ZUBBMta6GOZBe+/unOCFQirFlG/0WBWN+tAsuSo= X-Received: by 2002:a50:d6d7:0:b0:57c:60e8:c519 with SMTP id 4fb4d7f45d1cf-57c60e8c5c4mr4223569a12.16.1718030697825; Mon, 10 Jun 2024 07:44:57 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 10 Jun 2024 07:44:57 -0700 From: Stefan Kangas In-Reply-To: References: <86y17fbdkw.fsf@gnu.org> <87jzix1g4r.fsf@posteo.net> <865xuh2tpk.fsf@mail.linkov.net> <87frtl1djg.fsf@posteo.net> MIME-Version: 1.0 Date: Mon, 10 Jun 2024 07:44:57 -0700 Message-ID: Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse To: Alan Donovan , Philip Kaludercic Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71435 Cc: Eli Zaretskii , 71435@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Donovan writes: >> ?? 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. I can't reproduce that in emacs -Q. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 10 13:28:37 2024 Received: (at 71435) by debbugs.gnu.org; 10 Jun 2024 17:28:37 +0000 Received: from localhost ([127.0.0.1]:48327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGiou-0001qW-N8 for submit@debbugs.gnu.org; Mon, 10 Jun 2024 13:28:37 -0400 Received: from mail-pl1-f169.google.com ([209.85.214.169]:35967) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGios-0001q2-Ar for 71435@debbugs.gnu.org; Mon, 10 Jun 2024 13:28:35 -0400 Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1f61742a024so11315ad.0 for <71435@debbugs.gnu.org>; Mon, 10 Jun 2024 10:28:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718040431; x=1718645231; 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=IA3urorU7v8cvsYdpDZt7SQqgVfyHQ1Gbwcdzk82KeU=; b=YnIJ0N78DpAlhi4vi385U9MkUEPfi1OcB2GRpByoSZI1Q+bGgxYXBswq0nomkheMs4 8AOYeUqoY/HrIwoOtovGIB1C3lQ7B/cF6fC+4eMJcujiHQjLPUj+Vs+wNB7Jh/qKinZ6 syKgD08op9AnKVfMoWQk6/gO/62RFAbsi3tN04p0Un1x4KClsbPmuCXWpfP8x5C1y2fC 2npNlxBvzb9Kw+0H8HpqPT9s7zdFYBFWvgaTV0CrGx6mhx9Q2lXlnmh4GyceNWMeuavA OQ/czzDGBCbWWwJBcbO8GP9TGR6Wcparl2WIuWO2x6sTpEryZAMIhZuYphIP12qXlUdE lIEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718040431; x=1718645231; 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=IA3urorU7v8cvsYdpDZt7SQqgVfyHQ1Gbwcdzk82KeU=; b=tjyPzkGau3/zvGpcM1xiyrc/d/Os9iSBGd4cb1KEqNxy7r7jGrOieEZigt2ImdMYKe +oTW8rdrvTdN2JZXtk+6Ix2z+Ks1J+F9L7LfPQtEoPUrP/ruiC4OT/9CpD53KJ4C0LQq C53lpVNvYBIYEBaA6skqpUkGTfLnls8EDObzlVs3JUSnEg9BAgVwi49X6VHjU4/iAtyj Fs7nNReecRPXtW3lKkms/bTAAe5FY/cWbLKkm8F5QAjB6X9dn2c4NGbpRIEcNJU0AJW0 Ro+e37UKjmPhpessGDjhqA6aYHcRaNoEEMgt7KQoTlSBppbkzJ53AX8hKuIItL3u1GQx V7MQ== X-Forwarded-Encrypted: i=1; AJvYcCWs3Iu7VyHseAf14zDQ0nQ9V0wSijoGu2UEnnXVxBHuz/Qme6Pf++ADaddE2CG4+Wfx3eS0fh33h7y/fADM8GK5xM2Z5N4= X-Gm-Message-State: AOJu0Yy5t/EHsMeKmi/faBLH4zf4N4aEh4xvDUCmhrbkzbqGTw6xpd2t xzmlwZC9K3RQMtIrZxBxJ8wHKKxebCfWREb3fnr9p4XjhM2zZ4DJwixhyaiqAQncHDKevPXlaoQ c6pQMtT/0iBCPSW9z5NP0mxllWuztuesN59lQ X-Google-Smtp-Source: AGHT+IHyV/auThAU7fdk/N4nkjTL+lduxepiaBRNI4k1CeDNNbN4KqBVBMUupIvD6TcRx5hK3SbtFGU5NPdL1qguYP8= X-Received: by 2002:a17:902:694b:b0:1f6:5bba:8ea3 with SMTP id d9443c01a7336-1f6f0c368f3mr5200675ad.25.1718040430700; Mon, 10 Jun 2024 10:27:10 -0700 (PDT) MIME-Version: 1.0 References: <86y17fbdkw.fsf@gnu.org> <87jzix1g4r.fsf@posteo.net> <865xuh2tpk.fsf@mail.linkov.net> <87frtl1djg.fsf@posteo.net> <86le3c95zk.fsf@gnu.org> In-Reply-To: <86le3c95zk.fsf@gnu.org> From: Alan Donovan Date: Mon, 10 Jun 2024 13:26:59 -0400 Message-ID: Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000961f14061a8c7518" X-Spam-Score: -8.0 (--------) X-Debbugs-Envelope-To: 71435 Cc: philipk@posteo.net, 71435@debbugs.gnu.org, stefankangas@gmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -9.0 (---------) --000000000000961f14061a8c7518 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I can reliably reproduce the problem using this script: ;; reproducer for use in emacs -Q: ;; invoke load-file on this file, ;; then follow the interactive steps at the very end. (emacs-version) ; 29.3 (require 'eglot) ; 1.17.0 ;; --- these steps are documented at ;; https://github.com/golang/tools/blob/master/gopls/doc/emacs.md#configuring-= project-for-go-modules-in-emacs (require 'project) ; 0.11.0 (defun project-find-go-module (dir) (when-let ((root (locate-dominating-file dir "go.mod"))) (cons 'go-module root))) (cl-defmethod project-root ((project (head go-module))) (cdr project)) (add-hook 'project-find-functions #'project-find-go-module) ;; ----- ; Use your favorite modifier; s is super, aka =E2=8C=98 key on Mac. (global-set-key (kbd "s-") #'xref-find-definitions-at-mouse) ;; This file comes from github.com/dominikh/go-mode.el@master. (load-file "~/w/go-mode.el/go-mode.el") ;; Create a new Go buffer. (with-current-buffer (find-file "/tmp/a.go") (eglot-ensure) (insert "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println()\n}\n") (set-buffer (current-buffer))) ;; You should now be in a Go buffer in go-mode with eglot enabled. ;; ;; Now: position the point in "fmt", and then =E2=8C=98-click on "Println". ;; For me, Emacs navigates to the declaration of "fmt", not "Println". ;; The converse is true as well: with the point in Println, ;; a =E2=8C=98-click on fmt goes to the declaration of Println. On Mon, 10 Jun 2024 at 11:23, Eli Zaretskii wrote: > > From: Alan Donovan > > Date: Mon, 10 Jun 2024 10:39:04 -0400 > > Cc: Juri Linkov , Stefan Kangas , > > > Eli Zaretskii , 71435@debbugs.gnu.org > > > > > ?? 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 > > I cannot reproduce thus. I just tried, and the mouse click shows the > definition of identifier at mouse click, not at point. > > > 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. > > Please show a recipe for reproducing this, and please also tell what > version of Emacs are you using and on which platform. > > Thanks. > --000000000000961f14061a8c7518 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I can reliably reproduce the problem using this scrip= t:



;; reproducer for use in emacs -Q= :
;; invoke load-file on this file,
;; then follow the interactive st= eps at the very end.

(emacs-version) ; 29.3
(require 'eglot) = ; 1.17.0

;; --- these steps are documented at
;; https://github.com/golang/tools/blob/master/gop= ls/doc/emacs.md#configuring-project-for-go-modules-in-emacs

(req= uire 'project) ; 0.11.0

(defun project-find-go-module (dir)
= =C2=A0 (when-let ((root (locate-dominating-file dir "go.mod")))=C2=A0 =C2=A0 (cons 'go-module root)))

(cl-defmethod project-r= oot ((project (head go-module)))
=C2=A0 (cdr project))

(add-hook = 'project-find-functions #'project-find-go-module)
;; -----
; Use your favorite modifier; s is super, aka =E2=8C=98 key on Mac.
(g= lobal-set-key (kbd "s-<mouse-1>") #'xref-find-definitio= ns-at-mouse)

;; This file comes from github.com/dominikh/go-mode.el@master.
(lo= ad-file "~/w/go-mode.el/go-mode.el")

;; Create a new Go bu= ffer.
(with-current-buffer (find-file "/tmp/a.go")
=C2=A0 (= eglot-ensure)
=C2=A0 (insert "package main\n\nimport \"fmt\&qu= ot;\n\nfunc main() {\n\tfmt.Println()\n}\n")
=C2=A0 (set-buffer (cu= rrent-buffer)))

;; You should now be in a Go buffer in go-mode with = eglot enabled.
;;
;; Now: position the point in "fmt", and = then =E2=8C=98-click on "Println".
;; For me, Emacs navigates = to the declaration of "fmt", not "Println".
;; The c= onverse is true as well: with the point in Println,
;; a =E2=8C=98-click= on fmt goes to the declaration of Println.

On Mon, 10 Jun 2024 at 11:23= , Eli Zaretskii <eliz@gnu.org> wr= ote:
> From: = Alan Donovan <a= donovan@google.com>
> Date: Mon, 10 Jun 2024 10:39:04 -0400
> Cc: Juri Linkov <juri@linkov.net>, Stefan Kangas <stefankangas@gmail.com>,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0Eli Zaretskii <eliz@gnu.org>, 71435@debbugs.gnu.org
>
> > ?? This works for me:
> >=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 xref-find-definitions-at-mouse will use position= A as the basis of the query

I cannot reproduce thus.=C2=A0 I just tried, and the mouse click shows the<= br> definition of identifier at mouse click, not at point.

> So perhaps my request should instead have been expressed as a bug repo= rt: xref-find-definitions-at-mouse
> uses the point instead of the mouse event position.

Please show a recipe for reproducing this, and please also tell what
version of Emacs are you using and on which platform.

Thanks.
--000000000000961f14061a8c7518-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 10 13:55:29 2024 Received: (at 71435) by debbugs.gnu.org; 10 Jun 2024 17:55:29 +0000 Received: from localhost ([127.0.0.1]:49738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGjEs-00034a-4b for submit@debbugs.gnu.org; Mon, 10 Jun 2024 13:55:29 -0400 Received: from mout02.posteo.de ([185.67.36.66]:33345) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGj3r-0002X0-Av for 71435@debbugs.gnu.org; Mon, 10 Jun 2024 13:44:04 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id DA040240105 for <71435@debbugs.gnu.org>; Mon, 10 Jun 2024 19:43:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1718041419; bh=DGlMU1KJFrUb+FYngxBvB/pugoqsaFwKyhW5ygw4z44=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:From; b=Z17LViBnVbw2iwvJxot5fDWNGETIo+2AcZS/ONVuu6I3WUm3LSS6rX5afVOTdcBQ/ TOZnnxNU37EPBiJP5skk61LPHtHjDbZ6Si+t3m6VbtWLsHEAHK6FYXqTqncbYXBJxc mWxbHfrzdsnQoHYLDRiU/qPCNZfh1RPAAHknnWvmGSKZHznfOo3WZ0HjumkfmG57/b mGE6dBGv7q61T67jSVe3m9IVzpku+efmyP0JSVSMgS6rDeyLZFDZYbPtB34gduFovc I5V622qfcn9GpjVvTmsWGdvrFQ7yLQo4rqhnmxNDPJx2m436ztIZPajKZmAT3Hfp4F oZFHB/sRRprGg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VyfL254q9z9rxF; Mon, 10 Jun 2024 19:43:38 +0200 (CEST) From: Philip Kaludercic To: Alan Donovan Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse In-Reply-To: (Alan Donovan's message of "Mon, 10 Jun 2024 13:26:59 -0400") References: <86y17fbdkw.fsf@gnu.org> <87jzix1g4r.fsf@posteo.net> <865xuh2tpk.fsf@mail.linkov.net> <87frtl1djg.fsf@posteo.net> <86le3c95zk.fsf@gnu.org> OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt Date: Mon, 10 Jun 2024 17:43:38 +0000 Message-ID: <87zfrszoad.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71435 Cc: Eli Zaretskii , 71435@debbugs.gnu.org, stefankangas@gmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Alan Donovan writes: > I can reliably reproduce the problem using this script: > > > > ;; reproducer for use in emacs -Q: > ;; invoke load-file on this file, > ;; then follow the interactive steps at the very end. > > (emacs-version) ; 29.3 > (require 'eglot) ; 1.17.0 > > ;; --- these steps are documented at > ;; > https://github.com/golang/tools/blob/master/gopls/doc/emacs.md#configurin= g-project-for-go-modules-in-emacs > > (require 'project) ; 0.11.0 > > (defun project-find-go-module (dir) > (when-let ((root (locate-dominating-file dir "go.mod"))) > (cons 'go-module root))) > > (cl-defmethod project-root ((project (head go-module))) > (cdr project)) > > (add-hook 'project-find-functions #'project-find-go-module) > ;; ----- > > ; Use your favorite modifier; s is super, aka =E2=8C=98 key on Mac. > (global-set-key (kbd "s-") #'xref-find-definitions-at-mouse) > > ;; This file comes from github.com/dominikh/go-mode.el@master. > (load-file "~/w/go-mode.el/go-mode.el") > > ;; Create a new Go buffer. > (with-current-buffer (find-file "/tmp/a.go") > (eglot-ensure) > (insert "package main\n\nimport \"fmt\"\n\nfunc main() > {\n\tfmt.Println()\n}\n") > (set-buffer (current-buffer))) > > ;; You should now be in a Go buffer in go-mode with eglot enabled. > ;; > ;; Now: position the point in "fmt", and then =E2=8C=98-click on "Println= ". > ;; For me, Emacs navigates to the declaration of "fmt", not "Println". > ;; The converse is true as well: with the point in Println, > ;; a =E2=8C=98-click on fmt goes to the declaration of Println. Given that I have a working Go setup installed, I tried this out: With Emacs 30 on GNU/Linux fmt and Println both jump to the correct location. The most recent commit might have fixed the issue you are having: commit 128ed5c9f17fab87fdb679326035aa2598612658 Author: Dmitry Gutov Date: Thu Aug 31 03:21:11 2023 +0300 Add one more mouse-set-point call to functions xref-find-*-at-mouse =20=20=20=20 * lisp/progmodes/xref.el (xref-find-definitions-at-mouse) (xref-find-references-at-mouse): Call mouse-set-point to ensure that the search is initiated at the same place where xref-backend-identifier-at-point was called (bug#65578). diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 3f75f8d7132..dbafa00c3ad 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1638,7 +1638,9 @@ xref-find-definitions-at-mouse (mouse-set-point event) (xref-backend-identifier-at-point (xref-find-backend))))) (if identifier - (xref-find-definitions identifier) + (progn + (mouse-set-point event) + (xref-find-definitions identifier)) (user-error "No identifier here")))) =20 ;;;###autoload @@ -1652,6 +1654,7 @@ xref-find-references-at-mouse (xref-backend-identifier-at-point (xref-find-backend))))) (if identifier (let ((xref-prompt-for-identifier nil)) + (mouse-set-point event) (xref-find-references identifier)) (user-error "No identifier here")))) =20 There is a more recent version of Xref on ELPA, could you try installing that as well, and see if that changes anything? > On Mon, 10 Jun 2024 at 11:23, Eli Zaretskii wrote: > >> > From: Alan Donovan >> > Date: Mon, 10 Jun 2024 10:39:04 -0400 >> > Cc: Juri Linkov , Stefan Kangas , >> >> > Eli Zaretskii , 71435@debbugs.gnu.org >> > >> > > ?? 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 >> >> I cannot reproduce thus. I just tried, and the mouse click shows the >> definition of identifier at mouse click, not at point. >> >> > 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. >> >> Please show a recipe for reproducing this, and please also tell what >> version of Emacs are you using and on which platform. >> >> Thanks. >> --=20 Philip Kaludercic on peregrine From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 10 14:55:24 2024 Received: (at 71435) by debbugs.gnu.org; 10 Jun 2024 18:55:24 +0000 Received: from localhost ([127.0.0.1]:52695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGkAt-00009L-MW for submit@debbugs.gnu.org; Mon, 10 Jun 2024 14:55:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGjgO-00079v-7t for 71435@debbugs.gnu.org; Mon, 10 Jun 2024 14:23:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGjEm-000165-R0; Mon, 10 Jun 2024 13:55:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=3MWUVukdbm5QzpXeVF3q/axb6DJk5JrEbTb0TchD8t8=; b=klxNl+5GTMH8hi2EzxLo o4h8xUJ4QhJOT2zdf16UmXriZ6o/m+IfGP+7BLm0qUHpWyxY+VKZDTwyhg+pnYciy9ipkwhwF/SnV eDkydin7rnRyiPp+F+rh1NY08cqCzLHBsCKgydah4ZLdRvz5OBCwjUXPLf0LsC2CoyzxcmOtsR164 nm7AaV3IKkK0ZcbsMlX9mxQ+sRrJ46761Bzv1pkROsFp0ctYp5VGXPcT1OqD5Hna//rYN12XfNLwp OI3ezqYAU2JRn7yICHH8Wiy+j3+fjskx1U5jcZTChNu46RoYKd6VLq/30Iw6YsSjuTDyLO7mc+30H wKNaRUX/L9rkmA==; Date: Mon, 10 Jun 2024 20:55:11 +0300 Message-Id: <861q548yyo.fsf@gnu.org> From: Eli Zaretskii To: Alan Donovan In-Reply-To: (message from Alan Donovan on Mon, 10 Jun 2024 13:26:59 -0400) Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse References: <86y17fbdkw.fsf@gnu.org> <87jzix1g4r.fsf@posteo.net> <865xuh2tpk.fsf@mail.linkov.net> <87frtl1djg.fsf@posteo.net> <86le3c95zk.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71435 Cc: philipk@posteo.net, 71435@debbugs.gnu.org, stefankangas@gmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Alan Donovan > Date: Mon, 10 Jun 2024 13:26:59 -0400 > Cc: philipk@posteo.net, juri@linkov.net, stefankangas@gmail.com, > 71435@debbugs.gnu.org > > I can reliably reproduce the problem using this script: > > ;; reproducer for use in emacs -Q: > ;; invoke load-file on this file, > ;; then follow the interactive steps at the very end. > > (emacs-version) ; 29.3 > (require 'eglot) ; 1.17.0 > > ;; --- these steps are documented at > ;; > https://github.com/golang/tools/blob/master/gopls/doc/emacs.md#configuring-project-for-go-modules-in-emacs > > > (require 'project) ; 0.11.0 > > (defun project-find-go-module (dir) > (when-let ((root (locate-dominating-file dir "go.mod"))) > (cons 'go-module root))) > > (cl-defmethod project-root ((project (head go-module))) > (cdr project)) > > (add-hook 'project-find-functions #'project-find-go-module) > ;; ----- > > ; Use your favorite modifier; s is super, aka ⌘ key on Mac. > (global-set-key (kbd "s-") #'xref-find-definitions-at-mouse) > > ;; This file comes from github.com/dominikh/go-mode.el@master. > (load-file "~/w/go-mode.el/go-mode.el") > > ;; Create a new Go buffer. > (with-current-buffer (find-file "/tmp/a.go") > (eglot-ensure) > (insert "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println()\n}\n") > (set-buffer (current-buffer))) All that is needed to reproduce such a basic problem? Are you sure it isn't project-find-go-module that interferes here, for example? IOW, please try to systematically remove stuff from the recipe until you find the culprit. My guess is that it is some of the 3rd-party stuff you load, not Emacs. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 10 15:40:26 2024 Received: (at 71435-done) by debbugs.gnu.org; 10 Jun 2024 19:40:26 +0000 Received: from localhost ([127.0.0.1]:54983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGksS-00027X-Lt for submit@debbugs.gnu.org; Mon, 10 Jun 2024 15:40:26 -0400 Received: from mail-ej1-f42.google.com ([209.85.218.42]:45238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGkNB-0000ik-4b for 71435-done@debbugs.gnu.org; Mon, 10 Jun 2024 15:08:06 -0400 Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a6e349c0f2bso418453366b.2 for <71435-done@debbugs.gnu.org>; Mon, 10 Jun 2024 12:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718046402; x=1718651202; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=0Qp6xIUaGVxnkLPBXxmuQ0omfVOXFO3oqqcnm6WjMPs=; b=RYiy/g68vQRka578T+FkBsuMDa80HJZCO4XlcEO5jcmvjnDuN74KRzjz7Bnq0Duc67 vuX7huxpLHz86FOhLIOYUucxZdapcvlrfULrQ+ZIP+vRcChksUyWAGGpdEIvdM/aj0S9 R6LSuepZYmhhysDoW07G4QGBUcHJkNEIdychHAZKtlxKzQwiwaZyEGpC3SoFVw6izq8e Iw8tjpSnlnK76f/EQROWdNJeXcCAdEaZKo+OmOscz3MWaI281lPWx29r51SWQ4OgLd4O E6/lVT4JRgpQlqyglGEWhZB8SpWm4nxX9YV5iFSsm7iu+jswLPkbyp/+QQ9bH7FiGcz8 ehiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718046402; x=1718651202; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0Qp6xIUaGVxnkLPBXxmuQ0omfVOXFO3oqqcnm6WjMPs=; b=mRXSZvGXpgp15onQaJFxCCP7QA0K6/6BGhy3k09ylHFUx530FqQVljcBSwVLjMM8oc IdgQ6gWXYYFrh7m1ybxKvBiyMr3aP5d7gds1YS/ToObImNckPP4Q5xlaTMLgMU3xkK9V D3dYVEQISkJ1sCUOyT5AIOGLKR/sKGjBy7yk2VgOjlziqm3/fA1k86bD2a4tv2FZx3j/ cqRTTRRgE7E7lzfKhYQxqZNHQ7OOUDtxncq+kAv/Jr0hCYWe54B7ccfczPC0JZGoOee0 akcYXVFjV5FdFuuYUL2v1vHtbudTBlC9UK2+vxno87ZWy0ymbJuQHDkdxlFulmLlnJNh OhCQ== X-Forwarded-Encrypted: i=1; AJvYcCXHBXuHwMiwCOfVx0M1BvGy59XS4HoXBRe0Cz/KTX+RrUx9y2MIT2+sxwKEUxMNtdvsoW7JmXO6F8GYwoqdoY1+7M8TrKhf/Lj4fQ== X-Gm-Message-State: AOJu0YxFWshYpDdJEDhyFt7OffP8tntlDXwUKHIAc57+8ZXDR/w+o/o1 J/ueuyZzB7JRkXQCv9h9l4mgSTO6koG5qFRB3Z2QaqtwnE/IxH4DiSLdVnBJRBGPpCiFYLuCFV2 MXiKFQx8DRCVh0YvyZi9F7xMD0o9fpnoO X-Google-Smtp-Source: AGHT+IGokhwuqQk1ma3BRlHJAxYp2Z9wazuwCiOilJGQ8OLqfeAcEt83h/pNmJlU5FG4xgyUZzWw1KRQNCsn+Wiqm/M= X-Received: by 2002:a50:f685:0:b0:57c:6188:875a with SMTP id 4fb4d7f45d1cf-57c61889103mr4751867a12.26.1718045947213; Mon, 10 Jun 2024 11:59:07 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 10 Jun 2024 11:59:05 -0700 From: Stefan Kangas In-Reply-To: References: <86y17fbdkw.fsf@gnu.org> <87jzix1g4r.fsf@posteo.net> <865xuh2tpk.fsf@mail.linkov.net> <87frtl1djg.fsf@posteo.net> <86le3c95zk.fsf@gnu.org> <87zfrszoad.fsf@posteo.net> MIME-Version: 1.0 Date: Mon, 10 Jun 2024 11:59:05 -0700 Message-ID: Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse To: Alan Donovan , Philip Kaludercic Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71435-done Cc: Eli Zaretskii , 71435-done@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alan Donovan writes: > On Mon, 10 Jun 2024 at 13:43, Philip Kaludercic wrote: > >> Given that I have a working Go setup installed, I tried this out: With >> Emacs 30 on GNU/Linux fmt and Println both jump to the correct location. >> >> The most recent commit might have fixed the issue you are having: > > I applied that neat little patch, and it fixed it. Many thanks, and sorry > to take your time. Thanks for testing. I'm consequently closing this bug report. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 10 16:02:03 2024 Received: (at 71435) by debbugs.gnu.org; 10 Jun 2024 20:02:03 +0000 Received: from localhost ([127.0.0.1]:56374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGlDP-0003B1-4S for submit@debbugs.gnu.org; Mon, 10 Jun 2024 16:02:03 -0400 Received: from mail-qt1-f170.google.com ([209.85.160.170]:37065) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGlDN-0003AE-JF for 71435@debbugs.gnu.org; Mon, 10 Jun 2024 16:02:02 -0400 Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-44056f72257so77451cf.0 for <71435@debbugs.gnu.org>; Mon, 10 Jun 2024 13:01:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718049639; x=1718654439; 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=FD+8Ru0RE7/Kyzu283mKZ096JhSCAJEET8OQ0FKdO6M=; b=Ah3lTq/dpksR8S/HPFkl1geP0DAB+80l63OOJ4i2NE81D3ZZCVmTnMNSO0xPUmmwVt rBiXCAnZdlNy8gUT8KM17GdLU+9ue4l4LPqkV7F9A+f9ytVHWXnCIgbbzDWlIEPRfb7v 5bKOr0N62W1VC1EhAmtji44mr1EQkEsRnRgfOtJ4vuaWcjYlPB00BozeVtnZHK18Pvz2 KFH+b/0LyxkBmXgU7X2yzkgshOOt4rH+Xv31mAe/7P8RUjItBSiVpXRztqodfPw3+Lhf 33TQ1nsQdevUBH4amBZaYt5eVYbERMa+DxLDqcJnd1/74UzZvAfvIC5Go8fup6s+I+Uc p7eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718049639; x=1718654439; 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=FD+8Ru0RE7/Kyzu283mKZ096JhSCAJEET8OQ0FKdO6M=; b=nagK8pHd7Wt3SE9xrFtUDKao+KAWY8c0D6hBkyaTShokra0b/tSBUpQ+J4IDsLBKN3 oUXFpqTmVWVagbg6skOxxKSTaIiqzLIEZeEFXh0Mpq103m0ZkMfCBOqldxDez4PeYMdY VULEviJU+UeqZKp4LCvBSiB8fdF+tCtjkwIa7qk5YDX8s5//xah3TGDeztZouJ5mtA7m slqwdJMWfhs9WLvmEowBzWK+iiyTVLZruLYaxCfScqe6aLQkCRVs12L2feKj727vDQxV iH62DI9uFCiW5yFqlyaZSSR0zbczFmv2DZVS3YSlA2YUBQ7OODgUpGw7KLybWeUozTrw 03aQ== X-Forwarded-Encrypted: i=1; AJvYcCWL4F9v6zUpCzeY6LyJLpGu1CMaoOW/nFvYtQCqmk4sVFUXjaz6QbddkGDCUGVG6rmnI+ulAVF5x/p1j4p5Nk0/0e1YyWc= X-Gm-Message-State: AOJu0YzhpDs/3ZZVfS5KevSj/EiLCay7Voz4uWRj0URZO7kCW2G/biny kz2aO/Xa3OI6fZKjl7PSRc6F5WrK58kxqE+Wj/zqolXhRn/d/NWqqpJSWwMZyE7vxcREr9SQxrU NWzqZoMBTG8OYhNzNgXsj0iFI5THwOOo0Ng3gqzJ8qrMwe8WJG49j X-Google-Smtp-Source: AGHT+IEnmAT4CFJpWNI8SLo3hTVTGo1WaO6GjVk+omx9Ofz0r7dws+nAXCv8P/Lps4O01tr2I3oHTzaMqHzKTLJWd0I= X-Received: by 2002:a17:902:f646:b0:1f6:262c:6750 with SMTP id d9443c01a7336-1f72ab8fa78mr430155ad.0.1718045259212; Mon, 10 Jun 2024 11:47:39 -0700 (PDT) MIME-Version: 1.0 References: <86y17fbdkw.fsf@gnu.org> <87jzix1g4r.fsf@posteo.net> <865xuh2tpk.fsf@mail.linkov.net> <87frtl1djg.fsf@posteo.net> <86le3c95zk.fsf@gnu.org> <87zfrszoad.fsf@posteo.net> In-Reply-To: <87zfrszoad.fsf@posteo.net> From: Alan Donovan Date: Mon, 10 Jun 2024 14:47:27 -0400 Message-ID: Subject: Re: bug#71435: interactive xref-find-definitions-at-mouse To: Philip Kaludercic Content-Type: multipart/alternative; boundary="0000000000006267f9061a8d9530" X-Spam-Score: -8.0 (--------) X-Debbugs-Envelope-To: 71435 Cc: Eli Zaretskii , 71435@debbugs.gnu.org, stefankangas@gmail.com, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -9.0 (---------) --0000000000006267f9061a8d9530 Content-Type: text/plain; charset="UTF-8" On Mon, 10 Jun 2024 at 13:43, Philip Kaludercic wrote: > Given that I have a working Go setup installed, I tried this out: With > Emacs 30 on GNU/Linux fmt and Println both jump to the correct location. > > The most recent commit might have fixed the issue you are having: > I applied that neat little patch, and it fixed it. Many thanks, and sorry to take your time. --0000000000006267f9061a8d9530 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, 10 Jun 2024 at 13:43, Philip Kalu= dercic <philipk@posteo.net>= wrote:
Given that I have a working Go setup installed, I tried this out: With
Emacs 30 on GNU/Linux fmt and Println both jump to the correct location.
The most recent commit might have fixed the issue you are having:

I applied that neat little patch, and it fixed i= t. Many thanks, and sorry to take your time.
--0000000000006267f9061a8d9530-- From unknown Fri Jun 20 07:14:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 09 Jul 2024 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator