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.bugs Subject: bug#71068: 30.0.50; Incorrect xref positions for eglot-execute Date: Sun, 26 May 2024 06:04:56 +0300 Message-ID: <57e38600-785a-4a12-b69a-001e2e3e3977@gutov.dev> References: 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="31053"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Eshel Yaron , 71068@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 26 05:06:24 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 1sB4DI-0007rB-Cu for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 May 2024 05:06:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sB4Cq-0002t8-Lv; Sat, 25 May 2024 23:05:56 -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 1sB4Cp-0002so-GV for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 23:05:55 -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 1sB4Cp-00074R-83 for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 23:05:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sB4Cw-0007zg-FR for bug-gnu-emacs@gnu.org; Sat, 25 May 2024 23:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 May 2024 03:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71068 X-GNU-PR-Package: emacs Original-Received: via spool by 71068-submit@debbugs.gnu.org id=B71068.171669271430675 (code B ref 71068); Sun, 26 May 2024 03:06:02 +0000 Original-Received: (at 71068) by debbugs.gnu.org; 26 May 2024 03:05:14 +0000 Original-Received: from localhost ([127.0.0.1]:38086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sB4CA-0007yh-9I for submit@debbugs.gnu.org; Sat, 25 May 2024 23:05:14 -0400 Original-Received: from fhigh4-smtp.messagingengine.com ([103.168.172.155]:45671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sB4C8-0007yP-3m for 71068@debbugs.gnu.org; Sat, 25 May 2024 23:05:13 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id B96BF11401B2; Sat, 25 May 2024 23:04:58 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 25 May 2024 23:04:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=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:subject:subject:to:to; s=fm2; t=1716692698; x=1716779098; bh=9VFY40tq+xL1DGn4H2he3E4ZYs48PxChcbf1cM3m8CE=; b= OkaYjVZr492O4HARbAtcs6++/xhpig/WDAwCjQWtWlczUFukgWLxgFGi8gJFBnSV Baow0PUbpGqukQQSzVWrIO9nDT+DTDox+vizMdQfvnQb1+iEcrb4nR+5W5HZkkZY 07wtd8U486lVIAx4bYLW6N45eQWE+RsYLE2aP3tPClcDr+rIsib4QYz/HCbM6s/R x7zat9vvYxvD3xN0kfr2mEJB9vDBAnxFqrNw/r2jfje1xbtbTwmirtcbTJiwdEhb TO6deiOudL7c7h4zg+oYkky1vP15hQT8vwAAuFQ4CJN5L5+zrxKDlFDzqSWoKQlN aIS+Tj4QhCIpAxQF5Zp3VA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1716692698; x= 1716779098; bh=9VFY40tq+xL1DGn4H2he3E4ZYs48PxChcbf1cM3m8CE=; b=P 7sldDCRyWsRHnta1hwTFRDcT6fMcIAn0voyoq6qELAJqd1WbtfHTRbIwG+LrWzX5 a55DzI29KVrOYYCK/YrNxL76vzHwAqxgeSN0O1u1JWdcj5qRivJoVS5TjOhVxEZn XuvUTJ7LtEsZ2wA9secGkCpMEkFG/TVn5FBbW/LxAJCpkpEMgo86nHOrh9JFPNPc ByEm6hPDQj4BGw3LVpDgtHMYKWJdcnpRJnUOVZ1Jc5FMLaKh9p7j06LIvpGG3gw5 0aHOozP9S4HqEa8X0P2B65dujXYZLosvn1fz+bh3byJLsz1tSMGQO6b5XOtZ21JQ MatWXFZrcMtm97v/rGUQQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejuddgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtje ertddtvdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhu thhovhdruggvvheqnecuggftrfgrthhtvghrnheptdfhuedvtdevleegueelvedvjeevhe ffveevhedvuefftdefhfdvueeggfetgfdtnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 25 May 2024 23:04:57 -0400 (EDT) Content-Language: en-US In-Reply-To: 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:285920 Archived-At: Hi! Thanks for the report. On 19/05/2024 18:55, Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Using xref to find the definition of eglot-execute seems to yield > imprecise definition locations: > > 1. emacs -Q > 2. (require 'eglot) > 3. M-. eglot-execute RET > > This produces an*xref* buffer that lists two definitions: > > --8<---------------cut here---------------start------------->8--- > .../lisp/progmodes/eglot.el > (cl-defgeneric eglot-execute) > (cl-defmethod eglot-execute (server action)) > --8<---------------cut here---------------end--------------->8--- > > Following the first definition leads to the definition of > eglot-execute-command (which is different from eglot-execute, although > the former is defined right above the latter), while the second > definition leads to the top of the file. I've (hopefully) fixed the first problem just now in commit 2a12f39ffe8. Regarding the second one, looks like it's using a more advanced syntax that our functions haven't been taught about. Since the method has been defined through a :method property on defgeneric, I suppose cl--generic-search-method should be taught to search for such definitions too. The definition itself could be rewritten in a simpler fashion, though. Just using cl-defmethod (the generic is then created implicitly, and the arguments list is not repeated).