X-Loop: help-debbugs@HIDDEN
Subject: bug#71068: 30.0.50; Incorrect xref positions for eglot-execute
Resent-From: Eshel Yaron <me@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 19 May 2024 15:56:02 +0000
Resent-Message-ID: <handler.71068.B.171613415911217 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 71068
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: 71068 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.171613415911217
(code B ref -1); Sun, 19 May 2024 15:56:02 +0000
Received: (at submit) by debbugs.gnu.org; 19 May 2024 15:55:59 +0000
Received: from localhost ([127.0.0.1]:36807 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1s8itD-0002ur-GT
for submit <at> debbugs.gnu.org; Sun, 19 May 2024 11:55:59 -0400
Received: from lists.gnu.org ([209.51.188.17]:33890)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <me@HIDDEN>) id 1s8itA-0002ul-Oe
for submit <at> debbugs.gnu.org; Sun, 19 May 2024 11:55:57 -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 <me@HIDDEN>) id 1s8it6-0002Sx-5w
for bug-gnu-emacs@HIDDEN; Sun, 19 May 2024 11:55:52 -0400
Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1s8it4-00077e-Or
for bug-gnu-emacs@HIDDEN; Sun, 19 May 2024 11:55:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
s=mail; t=1716134146;
bh=BNxAyu0NM335ktXrydEh3Dp3sQiICjUq1l2dGRIprD4=;
h=From:To:Subject:Date:From;
b=fWn/8k5L16k8GNoTx9gnZmSLAEJc6YR5BrTbaHu37QxrdEkCZgjHb75rvTscGpbly
19If7cx0NrimRpivyIDV0eHeyp7SIlpcwUISqS9+TfvS3EGqLzTZQax69g86G0GUfp
hjKgG05urlpnTWW3ssuK/2MQ+GHHwCXLCIWEEgbht+Dy/RjhNUfyeKhfOBD4wKnJ/S
8x2Q4cby2+z1K7X2huKP4x+CHQv5S4v/Peh5nDHiMmRbCo5J+qjEPPO/h7fHL9AIH1
VK5COrI2c2pgEnviD/NJCDgR/nRhrN25kBVUjQfqlD3Yh0k6Xfxc/GQt5k/8zy345S
feiElQ5Ai6ZpA==
From: Eshel Yaron <me@HIDDEN>
X-Hashcash: 1:20:240519:bug-gnu-emacs@HIDDEN::o2isrHEkfNKDF8+X:8W/G
Date: Sun, 19 May 2024 17:55:44 +0200
Message-ID: <m134qd94ov.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@HIDDEN;
helo=eshelyaron.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001,
SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)
f
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.
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Eshel Yaron <me@HIDDEN> Subject: bug#71068: Acknowledgement (30.0.50; Incorrect xref positions for eglot-execute) Message-ID: <handler.71068.B.171613415911217.ack <at> debbugs.gnu.org> References: <m134qd94ov.fsf@HIDDEN> X-Gnu-PR-Message: ack 71068 X-Gnu-PR-Package: emacs Reply-To: 71068 <at> debbugs.gnu.org Date: Sun, 19 May 2024 15:56:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 71068 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 71068: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D71068 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN
Subject: bug#71068: 30.0.50; Incorrect xref positions for eglot-execute
Resent-From: Dmitry Gutov <dmitry@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 26 May 2024 03:06:02 +0000
Resent-Message-ID: <handler.71068.B71068.171669271430675 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71068
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: Eshel Yaron <me@HIDDEN>, 71068 <at> debbugs.gnu.org
Received: via spool by 71068-submit <at> debbugs.gnu.org id=B71068.171669271430675
(code B ref 71068); Sun, 26 May 2024 03:06:02 +0000
Received: (at 71068) by debbugs.gnu.org; 26 May 2024 03:05:14 +0000
Received: from localhost ([127.0.0.1]:38086 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1sB4CA-0007yh-9I
for submit <at> debbugs.gnu.org; Sat, 25 May 2024 23:05:14 -0400
Received: from fhigh4-smtp.messagingengine.com ([103.168.172.155]:45671)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <dmitry@HIDDEN>) id 1sB4C8-0007yP-3m
for 71068 <at> debbugs.gnu.org; Sat, 25 May 2024 23:05:13 -0400
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)
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: <xms:2qZSZrrx7y2sFF71pjHXMzMHyYINTQXmCDPziTVlJBB5x6tvZc13ig>
<xme:2qZSZlokxY1XzTvTDT8bMuAq08jy-nPGlcwh49WSfkUn6n7mVx0Q471HqjimJRYpk
QJ5qWzsI_RDGHE5U9Q>
X-ME-Received: <xmr:2qZSZoOu8QF5TIxD6wc8pUFz5PdRMcTnq1SeR8F29GxENI08SDuryK8NgFGoJ6GhSyC1>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejuddgieehucetufdoteggodetrfdotf
fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtje
ertddtvdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhu
thhovhdruggvvheqnecuggftrfgrthhtvghrnheptdfhuedvtdevleegueelvedvjeevhe
ffveevhedvuefftdefhfdvueeggfetgfdtnecuvehluhhsthgvrhfuihiivgeptdenucfr
rghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv
X-ME-Proxy: <xmx:2qZSZu5rWLZbFfzKB6bZr0Gf3Ck02h_54Oi1oqCY4ttSayeaGRgMUw>
<xmx:2qZSZq6MSTTKn4PXCseN53xLXjaqRWMA8k-EJ_wzY4nHDHbcy1AqEA>
<xmx:2qZSZmjWA22uO0DfWPsCfdVGRzvQGHEhWkRyCx_iiTtqeeCUmXdWqg>
<xmx:2qZSZs5LwSfehsJFtCR3t7GD4J0CvkMLYgo46lVqK2Tybh12MpvH7Q>
<xmx:2qZSZqFBzI8EZ3Awsz9fOQdyjPe1V3KRu3G2vQj5-6pGKLrmFGLBOkiv>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
25 May 2024 23:04:57 -0400 (EDT)
Message-ID: <57e38600-785a-4a12-b69a-001e2e3e3977@HIDDEN>
Date: Sun, 26 May 2024 06:04:56 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <m134qd94ov.fsf@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <m134qd94ov.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
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).
X-Loop: help-debbugs@HIDDEN
Subject: bug#71068: 30.0.50; Incorrect xref positions for eglot-execute
Resent-From: Eshel Yaron <me@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 26 May 2024 08:02:01 +0000
Resent-Message-ID: <handler.71068.B71068.171671047028818 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71068
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: Dmitry Gutov <dmitry@HIDDEN>
Cc: 71068 <at> debbugs.gnu.org
Received: via spool by 71068-submit <at> debbugs.gnu.org id=B71068.171671047028818
(code B ref 71068); Sun, 26 May 2024 08:02:01 +0000
Received: (at 71068) by debbugs.gnu.org; 26 May 2024 08:01:10 +0000
Received: from localhost ([127.0.0.1]:38272 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1sB8oX-0007Uk-N2
for submit <at> debbugs.gnu.org; Sun, 26 May 2024 04:01:10 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:34752 helo=eshelyaron.com)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <me@HIDDEN>) id 1sB8oW-0007Uc-Ch
for 71068 <at> debbugs.gnu.org; Sun, 26 May 2024 04:01:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
s=mail; t=1716710459;
bh=35+2ej1QCJI5v4ZZQrtIEdEMngq3WelhrgZ18mYbcZo=;
h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
b=XN9gSgjfHaXqJ6zDQiYWu2tvLUA42AYjufLXAyjzxk9a3BHV5jDRNccCf4Vhj5S6O
SMJwV8mFz/jx2Y/m0y2wUDNj8z1rLA6OKpMCuRwvqWg6ATuQ/INQ0yiS5+O6uyaJsj
KtQuL2WB+y8z+DCIoJzXOA4C9qZ1DG2vMt5F3a8RuoCPQqDSlWP7Fi4Ln/dT0eaXaT
9baM2u+KiwSb1MsYIlwY2JC/aAl5n9UzvdEo8hV082coNqlilSz6G5NjVoKIAB5+0t
Lm0vzN9srtRRNa/VGOHhqEyNY/wtIuBdgx3tr88O26qo3ngLcZ2Jy5jh09IPrT9J35
gn2BuoDiMkUlQ==
From: Eshel Yaron <me@HIDDEN>
In-Reply-To: <57e38600-785a-4a12-b69a-001e2e3e3977@HIDDEN> (Dmitry Gutov's
message of "Sun, 26 May 2024 06:04:56 +0300")
References: <m134qd94ov.fsf@HIDDEN>
<57e38600-785a-4a12-b69a-001e2e3e3977@HIDDEN>
Date: Sun, 26 May 2024 10:00:57 +0200
Message-ID: <m1r0dpf1dy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)
Dmitry Gutov <dmitry@HIDDEN> writes:
> 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.
Thanks, that works well.
> 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.
Yes, seems so. Here's a lightly tested attempt at that:
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index c08441ca37f..dc127552ed2 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -1066,24 +1066,32 @@ cl-find-method
(defun cl--generic-search-method (met-name)
"For `find-function-regexp-alist'. Search for a `cl-defmethod'.
MET-NAME is as returned by `cl--generic-load-hist-format'."
- (let ((base-re (concat "(\\(?:cl-\\)?defmethod[ \t]+"
- (regexp-quote (format "%s" (car met-name)))
- "\\_>")))
- (or
- (re-search-forward
- (concat base-re "[^&\"\n]*"
- (mapconcat (lambda (qualifier)
- (regexp-quote (format "%S" qualifier)))
- (cadr met-name)
- "[ \t\n]*")
- (mapconcat (lambda (specializer)
- (regexp-quote
- (format "%S" (if (consp specializer)
- (nth 1 specializer) specializer))))
- (remq t (cddr met-name))
- "[ \t\n]*)[^&\"\n]*"))
- nil t)
- (re-search-forward base-re nil t))))
+ (let* ((name (format "%s" (car met-name)))
+ (base-re (concat "(\\(?:cl-\\)?defmethod[ \t]+"
+ (regexp-quote name)
+ "\\_>"))
+ (search (lambda (base &optional bound)
+ (re-search-forward
+ (concat base "[^&\"\n]*"
+ (mapconcat (lambda (qualifier)
+ (regexp-quote (format "%S" qualifier)))
+ (cadr met-name)
+ "[ \t\n]*")
+ (mapconcat (lambda (specializer)
+ (regexp-quote
+ (format "%S" (if (consp specializer)
+ (nth 1 specializer)
+ specializer))))
+ (remq t (cddr met-name))
+ "[ \t\n]*)[^&\"\n]*"))
+ bound t))))
+ (or (and (re-search-forward (format cl--generic-find-defgeneric-regexp name)
+ nil t)
+ (or (funcall search ":method[ \t\n]+"
+ (save-excursion (end-of-defun) (point)))
+ (not (goto-char (point-min)))))
+ (funcall search base-re)
+ (re-search-forward base-re nil t))))
;; WORKAROUND: This can't be a defconst due to bug#21237.
(defvar cl--generic-find-defgeneric-regexp "(\\(?:cl-\\)?defgeneric[ \t]+%s\\_>")
X-Loop: help-debbugs@HIDDEN
Subject: bug#71068: 30.0.50; Incorrect xref positions for eglot-execute
Resent-From: Dmitry Gutov <dmitry@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 29 May 2024 01:38:01 +0000
Resent-Message-ID: <handler.71068.B71068.171694664424734 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71068
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: Eshel Yaron <me@HIDDEN>
Cc: 71068 <at> debbugs.gnu.org
Received: via spool by 71068-submit <at> debbugs.gnu.org id=B71068.171694664424734
(code B ref 71068); Wed, 29 May 2024 01:38:01 +0000
Received: (at 71068) by debbugs.gnu.org; 29 May 2024 01:37:24 +0000
Received: from localhost ([127.0.0.1]:39061 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1sC8Fn-0006Qr-Pj
for submit <at> debbugs.gnu.org; Tue, 28 May 2024 21:37:24 -0400
Received: from wfout4-smtp.messagingengine.com ([64.147.123.147]:50061)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <dmitry@HIDDEN>) id 1sC8Fj-0006QR-Rd
for 71068 <at> debbugs.gnu.org; Tue, 28 May 2024 21:37:22 -0400
Received: from compute2.internal (compute2.nyi.internal [10.202.2.46])
by mailfout.west.internal (Postfix) with ESMTP id 624CB1C00101;
Tue, 28 May 2024 21:37:03 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
by compute2.internal (MEProxy); Tue, 28 May 2024 21:37:03 -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:subject:subject:to:to; s=fm3; t=1716946623;
x=1717033023; bh=BdhJlbfKqLY/jhFOzMKAf/e93c85SLqXcTotWRGgKSE=; b=
U4FGVWhsjGXXEH/XTv9DOWVRVrhZCEkbjFlTLq4sC7nJG3PJmYmDTWzSjOV2hB1Q
yGjjdU435gIU1I2PfCoyY8UjxLdldoEPnCn9M+dWb6xDD93DWmVtY3Y4LQ+RQxhZ
Z6137DUGlpq50hcT5R4AP3tjc1x/5TLghV+jFFkHHideCGJhUWpJ/1MyfrnLj+A4
ZI/NFhqCTXKKb1oSQRVPv70vLfV6rfX3qT4xCRo+ir2vawPiVKf5PQDQleWHEDrS
4HlfhxRaUqhyJRtVYUluzdAcOta1r4hMUUaYXe1D+5vi4vkOjcXfiHEd38hc8jqy
nGtMKFC3Kf40esow+W5R7g==
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:subject:subject:to:to:x-me-proxy:x-me-proxy
:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1716946623; x=
1717033023; bh=BdhJlbfKqLY/jhFOzMKAf/e93c85SLqXcTotWRGgKSE=; b=P
1NEfWJu9S1xCTXDpc5QiBcDUSbislpE1FoEUv1UQRHBdgExnQtD4dzWWvtNjdoE0
fa0GwuHuSieCM/jnUwY6CNRqRYaJ3TJW1l3H9yPtX0iaLFPWeuwm9wsXmjCKxBRz
kZIHgMlExY7K4pg28jmx45G9Gs6sOHyYwbQuIwhzBSi20jkNoU54PzHqf4EIwP6B
bh0qjBYhQhSLfz6jm2xrOSWEO9a1LDFFiLj9IhJaGtZ7mugoQ+KHjqfi5CRrtoy6
47f1xPH/XMPFL6OmrqxwqYwTk5qRlUoi7V1yGChfmuwq4C9O97GWR5MpGH/ppA7C
Ta29UamG4S842GbNERjYA==
X-ME-Sender: <xms:voZWZod6NeY11tPz3KN3huJ68dRBIqh6-1hni2zK9qoKntkGDI1eBg>
<xme:voZWZqORRF86iTZIWBIiS-iXoDAwlQb0Ie-Y2oIW_SzigldrIvUtTnRLXy5Jy9sIx
DtBdSBYDL2A1lnjzfc>
X-ME-Received: <xmr:voZWZpjMrr4Dz1fMiFP69UdzNOyh5fnixuiq4gqanHYgYaQ6rDX6w81s6Ug5zjIJQDXb>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejledggeekucetufdoteggodetrfdotf
fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfevfhfhjggtgfesth
ejredttddvjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehg
uhhtohhvrdguvghvqeenucggtffrrghtthgvrhhnpeetudeljeegheetgfehgeejkeeuhe
dvveeikeeufedtvddtveefhfdvveegudejheenucevlhhushhtvghrufhiiigvpedtnecu
rfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh
X-ME-Proxy: <xmx:voZWZt8YQe0sM6GY1AhnBeYWPHnItDLSsQRTDrHDtTm17i-x-RahZg>
<xmx:voZWZku15wzvufSsrcRmpVVruD-aLnuhoLRvI-ww1etEPjA-WOWpVg>
<xmx:voZWZkEvlFfq958IBPO4wlUv2LEXqH7gJTZ2HN8Sdb29akD2pn9kwg>
<xmx:voZWZjMWFs3tSVC8z8VhONwbzLVSe4Wt1t0VQVsAprFTLMYyg7c4dQ>
<xmx:v4ZWZt4AGhl1oPExteYVu03-mDnUkX3ysk1cSlktcX3T-GVdfE-LmGFF>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
28 May 2024 21:37:01 -0400 (EDT)
Message-ID: <508511e2-f964-420d-a453-b098303c5def@HIDDEN>
Date: Wed, 29 May 2024 04:37:00 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <m134qd94ov.fsf@HIDDEN>
<57e38600-785a-4a12-b69a-001e2e3e3977@HIDDEN>
<m1r0dpf1dy.fsf@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <m1r0dpf1dy.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
On 26/05/2024 11:00, Eshel Yaron wrote:
> + (or (and (re-search-forward (format cl--generic-find-defgeneric-regexp name)
> + nil t)
> + (or (funcall search ":method[ \t\n]+"
> + (save-excursion (end-of-defun) (point)))
> + (not (goto-char (point-min)))))
> + (funcall search base-re)
Should the second clause also be wrapped in some save-excursion or similar?
And I'd probably change the order (looking for the variations on
defmethod first), but that's not too important.
X-Loop: help-debbugs@HIDDEN
Subject: bug#71068: 30.0.50; Incorrect xref positions for eglot-execute
Resent-From: Eshel Yaron <me@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 03 Jun 2024 05:48:02 +0000
Resent-Message-ID: <handler.71068.B71068.171739366821298 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71068
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: Dmitry Gutov <dmitry@HIDDEN>
Cc: 71068 <at> debbugs.gnu.org
Received: via spool by 71068-submit <at> debbugs.gnu.org id=B71068.171739366821298
(code B ref 71068); Mon, 03 Jun 2024 05:48:02 +0000
Received: (at 71068) by debbugs.gnu.org; 3 Jun 2024 05:47:48 +0000
Received: from localhost ([127.0.0.1]:46822 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1sE0Xr-0005XR-SJ
for submit <at> debbugs.gnu.org; Mon, 03 Jun 2024 01:47:48 -0400
Received: from mail.eshelyaron.com ([107.175.124.16]:55648 helo=eshelyaron.com)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <me@HIDDEN>) id 1sE0Xp-0005XF-Ux
for 71068 <at> debbugs.gnu.org; Mon, 03 Jun 2024 01:47:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
s=mail; t=1717393652;
bh=8f/sglh2OAUZQe9WyZZ3pHgZpd8hfOF/2d8sbkQoWMo=;
h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
b=eE7St1L17GUPMeKoqxXnytTJo+lJhlOYbZPX3fy5Pi4JCy5W40Js8A0Ks5Rsv2SUg
Mo4W3Kc1275rPsiL0cnfZd8Vwhv70oI3SezUEGi3gqsDBxoNT28QkdL9vSQSUOhqLn
LZyrcEXVBYNxl3drX+2iqEuh2KXEiRToVntjotRb9WXPASwsH/DsIeYdwEN4E4FY7N
E3FBZzxPGYckyvGVZ8t+jO9mMofmqPCxOcouBPn+1P2j5TFkb0W2vXH/WbsCyPh9s+
qhYGot8QkQpOQR2hLKLotbV1+BJ7gGltE6GueJzGFJyWDfkvTJLVYuuriEMQvj04QB
6FDWNdb5y8b6A==
From: Eshel Yaron <me@HIDDEN>
In-Reply-To: <508511e2-f964-420d-a453-b098303c5def@HIDDEN> (Dmitry Gutov's
message of "Wed, 29 May 2024 04:37:00 +0300")
References: <m134qd94ov.fsf@HIDDEN>
<57e38600-785a-4a12-b69a-001e2e3e3977@HIDDEN>
<m1r0dpf1dy.fsf@HIDDEN>
<508511e2-f964-420d-a453-b098303c5def@HIDDEN>
Date: Mon, 03 Jun 2024 07:47:29 +0200
Message-ID: <m1plsy8tn2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)
Hi Dmitry,
Dmitry Gutov <dmitry@HIDDEN> writes:
> On 26/05/2024 11:00, Eshel Yaron wrote:
>> + (or (and (re-search-forward (format cl--generic-find-defgeneric-regexp name)
>> + nil t)
>> + (or (funcall search ":method[ \t\n]+"
>> + (save-excursion (end-of-defun) (point)))
>> + (not (goto-char (point-min)))))
>> + (funcall search base-re)
>
> Should the second clause also be wrapped in some save-excursion or similar?
Do you mean the (funcall search base-re) part? If so, then no, it
doesn't need save-excursion because it just calls re-search-forward,
which doesn't move point when the search fails.
> And I'd probably change the order (looking for the variations on
> defmethod first), but that's not too important.
Actually I think neither order is quite correct for all cases, because the
regex we construct is currently too lax: if we're searching for a method
definition with no specializers, it also matches definitions with
specializers. So ISTM that this needs some more work to get right.
If no one beats me to it, I'll look into it when I have some time.
Best,
Eshel
X-Loop: help-debbugs@HIDDEN
Subject: bug#71068: 30.0.50; Incorrect xref positions for eglot-execute
Resent-From: Dmitry Gutov <dmitry@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 03 Jun 2024 11:37:02 +0000
Resent-Message-ID: <handler.71068.B71068.171741458415841 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 71068
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords:
To: Eshel Yaron <me@HIDDEN>
Cc: 71068 <at> debbugs.gnu.org
Received: via spool by 71068-submit <at> debbugs.gnu.org id=B71068.171741458415841
(code B ref 71068); Mon, 03 Jun 2024 11:37:02 +0000
Received: (at 71068) by debbugs.gnu.org; 3 Jun 2024 11:36:24 +0000
Received: from localhost ([127.0.0.1]:60349 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1sE5zE-00047P-Ey
for submit <at> debbugs.gnu.org; Mon, 03 Jun 2024 07:36:24 -0400
Received: from wfout5-smtp.messagingengine.com ([64.147.123.148]:50601)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <dmitry@HIDDEN>) id 1sE5zD-00046r-6H
for 71068 <at> debbugs.gnu.org; Mon, 03 Jun 2024 07:36:23 -0400
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
by mailfout.west.internal (Postfix) with ESMTP id 795F11C000AE;
Mon, 3 Jun 2024 07:27:45 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
by compute1.internal (MEProxy); Mon, 03 Jun 2024 07:27:45 -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:subject:subject:to:to; s=fm3; t=1717414065;
x=1717500465; bh=oElZXDsWa2coVm2hzJPBswxek3/pS9c7ulMwSv10NTc=; b=
HkLxPgVVC2WCJNjb1DWbPMYmMmIJDwcE3bbY9Lx7L9QvrhhTuvNfHGAnBZ/mSrnj
6T6wjlAFWGdciJlLeha4qCB3JrFI/DI/OkHYaw9Nh8MEj3fLULUs54ses4G4nW2v
GeacGn/eV34OHgOz9r1XjY1TVfbsH9qiahiY6/A2CobXixZPJKJBOoIJmRPnoqpT
D3mAmk/eLVM5w+AVNlKxi4qPYdm/QEja5yYGkrZEh9zchbG+eUpFR8M2xObeH7yc
W7tDpxXtsnauPN5q7a+zuPDmSe6fS5auSJDJ4HwN/t5STYxVT5biFcKmHqMuvvHp
zD9GVuYru3lAqSCXGiKybw==
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:subject:subject:to:to:x-me-proxy:x-me-proxy
:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717414065; x=
1717500465; bh=oElZXDsWa2coVm2hzJPBswxek3/pS9c7ulMwSv10NTc=; b=H
ddusULiUXCAwCc5GJJIQfB1ekfhq1X2HCQKweN9nfiVrk4LyPIVx5sZxAezHdtd8
ucsJsaQ3LsQzj2dYqklMGSeknaX63KFKVJLRJ+QOOZHupcrxv0TNW/cObevqbLOa
CrfOFybGF/jl6dccsfuhfvTymInBKAUADdkZytSKLPwYIRT+TGgkDV9DR+tgA3iA
jY/HemTjD1YejbutsNu/FX7+XabSQd6EarKqve4WANeFk2XJ6TVuu2FMQTJqzpNA
RP2axJBkoYkEW0Z2qjAMr1by6eisl3k1XUj3j741QznGRJU/kBQ6t49qSmA8QWKV
41voMEvJWKaWrWHMpFKjA==
X-ME-Sender: <xms:sKhdZq-W7G2e3A9Zhv-130MRhnkMgJBUKnxm7jiDWP8A4BGc4mWFWQ>
<xme:sKhdZqt-Z1BkzkyDtgEim-ZYbnoo-w5s9ETDdvefxxtJF_EZwqX3nQ5M6zGX4ttmH
b74yyz7_jjbd1sxx-8>
X-ME-Received: <xmr:sKhdZgDp4j6ZZylGrZ9iNOnzqD6hu3PS8Z9RbDEPoD1ySo5GdkfuXHPFvr3uEHbYPCkv>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelvddggedtucetufdoteggodetrfdotf
fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfevfhfhjggtgfesth
ejredttddvjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehg
uhhtohhvrdguvghvqeenucggtffrrghtthgvrhhnpeetudeljeegheetgfehgeejkeeuhe
dvveeikeeufedtvddtveefhfdvveegudejheenucevlhhushhtvghrufhiiigvpedtnecu
rfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh
X-ME-Proxy: <xmx:sKhdZieh1rSJ9mkm73YuVveQOGqYDfssANDpxx6I9EBP8p0O4bAiig>
<xmx:sKhdZvNrY3JkEpaGD875ks4y01C-9WtcxouhGJpYNzgpVyRhetX_gw>
<xmx:sKhdZsnkO8bKiFj9sGf9qYIxxqSoBgrpvMMXt8iKRP1ZOoZZ3rz-yw>
<xmx:sKhdZhuR9uB5De3wry0wIVOU6OWVbgYCJXhbUaN01wcA-6kV-stbSQ>
<xmx:sahdZobkxsLEO2nk0jKT1FStVJf-44X9tNhg9kcPQnDB5PPAA1BKX_zs>
Feedback-ID: i0e71465a:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
3 Jun 2024 07:27:44 -0400 (EDT)
Message-ID: <541c1ea5-64b9-4fdc-a337-b7f1ac3934a6@HIDDEN>
Date: Mon, 3 Jun 2024 14:27:42 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
References: <m134qd94ov.fsf@HIDDEN>
<57e38600-785a-4a12-b69a-001e2e3e3977@HIDDEN>
<m1r0dpf1dy.fsf@HIDDEN>
<508511e2-f964-420d-a453-b098303c5def@HIDDEN>
<m1plsy8tn2.fsf@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <m1plsy8tn2.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
On 03/06/2024 08:47, Eshel Yaron wrote:
> Hi Dmitry,
>
> Dmitry Gutov <dmitry@HIDDEN> writes:
>
>> On 26/05/2024 11:00, Eshel Yaron wrote:
>>> + (or (and (re-search-forward (format cl--generic-find-defgeneric-regexp name)
>>> + nil t)
>>> + (or (funcall search ":method[ \t\n]+"
>>> + (save-excursion (end-of-defun) (point)))
>>> + (not (goto-char (point-min)))))
>>> + (funcall search base-re)
>>
>> Should the second clause also be wrapped in some save-excursion or similar?
>
> Do you mean the (funcall search base-re) part? If so, then no, it
> doesn't need save-excursion because it just calls re-search-forward,
> which doesn't move point when the search fails.
Fair point.
>> And I'd probably change the order (looking for the variations on
>> defmethod first), but that's not too important.
>
> Actually I think neither order is quite correct for all cases, because the
> regex we construct is currently too lax: if we're searching for a method
> definition with no specializers, it also matches definitions with
> specializers. So ISTM that this needs some more work to get right.
> If no one beats me to it, I'll look into it when I have some time.
Thanks.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.