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: master 128ed5c9f17: Add one more mouse-set-point call to functions xref-find-*-at-mouse Date: Thu, 31 Aug 2023 05:05:50 +0300 Message-ID: <6c5251b1-c289-07cf-587d-013c781e31f5@gutov.dev> References: <169344150641.11482.13012085201452768898@vcs2.savannah.gnu.org> <20230831002506.C0C6DC038B5@vcs2.savannah.gnu.org> <87il8wt52f.fsf@yahoo.com> <583ae120-d016-e9e8-2783-db21c1e018b8@gutov.dev> <87edjkt3sn.fsf@yahoo.com> 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="29680"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 31 04:07:01 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 1qbX5H-0007So-5P for ged-emacs-devel@m.gmane-mx.org; Thu, 31 Aug 2023 04:07:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbX4J-0002ew-9F; Wed, 30 Aug 2023 22:05:59 -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 1qbX4F-0002eh-0C for emacs-devel@gnu.org; Wed, 30 Aug 2023 22:05:55 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbX4C-0005sp-OA for emacs-devel@gnu.org; Wed, 30 Aug 2023 22:05:54 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4F5995C0189; Wed, 30 Aug 2023 22:05:52 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 30 Aug 2023 22:05:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693447552; x=1693533952; bh=wdXoNCG11rCuAqBWw9GfnwAR5cnPMZTgl/R sgTxMVHw=; b=Dcq2Lgc2afUab5HR4nFZaTH2F8ymgDUtoRmf7WQyWsKeArPm+hJ pCKHSF+tNj6i02tdES4di4dCurwz+tn/zwXsx1EBHXuN4knVUcVdab7BSgfIdPsI P7IpqvVaNLomcY3wvUxVCq4T8fXA5pLJHDS/pPKNPDnKD3aDf+KhJc/ibMym6F8y Kn2Z724rIxqYfC1wvDypS8mrJCmyAH7wGHhzqKAuXnrJRw38NkrumZ+S2Udt8kzk ieJObj6uV/WlVjaHlvzt9uLsfPyfJx1rEPtYzPAJPrGocDSmIt9MbqjQ/HadBvDO tPaTPfr1vCWgvYImyrwYtglVC4SSfhJruag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693447552; x=1693533952; bh=wdXoNCG11rCuAqBWw9GfnwAR5cnPMZTgl/R sgTxMVHw=; b=H4pikSA3lGNZWBObrBr93UJcj4LyRYy6PgcJVdZ92wjNL/2W0Lw hX+UMCA69K+L6nDebBQMzR72w8xtP5rmAkJGACj0ZfnEOL0/i6ymK2lCusylQEPM ddkCTGHoD/gfGg8O6rn7VardH0LnwtSiiiIyWz60GIEgvoIaDAcW1siIZ51JNc2D nwVYRq/BJpNto/+RvFx8dHcBup71mKDRnK9W7fBpO0mMrEi3lRhkGp9S8bLxXIrT 8vvlxpWiQQq+g6mRos/wH9np+hKxbrC/wp/xBeEuSX+jK8Ph01Qv6C4K0k0pLa5U SWwoFc43GAkP3IaYlTQtfiXKYsEXP0ud55w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudefledgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfevfhfhjggtgfesth ejredttdefjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehg uhhtohhvrdguvghvqeenucggtffrrghtthgvrhhnpeeigfetveehveevffehledtueekie eikeeufeegudfgfeeghfdulefgfeevledvveenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 30 Aug 2023 22:05:51 -0400 (EDT) Content-Language: en-US In-Reply-To: <87edjkt3sn.fsf@yahoo.com> Received-SPF: pass client-ip=66.111.4.27; envelope-from=dmitry@gutov.dev; helo=out3-smtp.messagingengine.com X-Spam_score_int: -39 X-Spam_score: -4.0 X-Spam_bar: ---- X-Spam_report: (-4.0 / 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, NICE_REPLY_A=-1.242, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-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:309571 Archived-At: On 31/08/2023 04:10, Po Lu wrote: >> On 31/08/2023 03:43, Po Lu wrote: >>> My experience with the entire touch screen affair says that many such >>> errors would never have been written had `xref-find-definitions' taken >>> an EVENT argument and used its posn-point if present. Something to >>> consider, I suppose. >> Sorry, I don't quite understand which change you have in mind. >> >> The issue here was that we needed to move to the click's location both >> when detecting the identifier (at that point), and before using the >> identifier to find a set of locations. >> >> If we used a POSN value, it would also have to be used in two places, >> I guess. One of which we could just as easily missed as we had here. > In my opinion, commands or functions that respond to the location of a > click should always take an EVENT argument, and use: > > (posn-point (event-start event)) > > if EVENT is present and incorporates a mouse position list. Rather than > searching for an identifier at point, it should search for an identifier > at the point of the mouse click. Adhering to such a convention is > almost guaranteed to eliminate every bug where Emacs consults something > under point instead of the mouse pointer when the user meant the latter. Sorry, I'm still not seeing your point. Especially the last paragraph in my last email seems to remain unaddressed. And both commands take EVENT as an argument already. The problem is not where is searched for an identifier, but *from where* it searched for the identifier's locations. And that position is important only for particular Xref backends (both LSP-based ones, I'm assuming).