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#53749: 29.0.50; [PATCH] Xref backend for TeX buffers Date: Tue, 7 May 2024 05:06:36 +0300 Message-ID: <175a4316-bb92-424a-8cca-07ffa6de8aba@yandex.ru> References: <8735d20yvd.fsf@gnus.org> <2c5c8afa-b57e-3156-d21c-5523cacb4d87@yandex.ru> <831qf1mgjl.fsf@gnu.org> <87cyyj9rpp.fsf@gnu.org> <65793.1694843596@localhost> 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="17030"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 53749@debbugs.gnu.org, Ikumi Keita , Arash Esbati , Stefan Monnier , Tassilo Horn , Eli Zaretskii , stefankangas@gmail.com To: David Fussner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 07 04:07:48 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 1s4AF8-0004BJ-FA for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 May 2024 04:07:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4AF0-0003QN-UP; Mon, 06 May 2024 22:07:38 -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 1s4AEz-0003Q3-FJ for bug-gnu-emacs@gnu.org; Mon, 06 May 2024 22:07:37 -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 1s4AEz-00082v-6L for bug-gnu-emacs@gnu.org; Mon, 06 May 2024 22:07:37 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s4AFN-0002Dq-Lx for bug-gnu-emacs@gnu.org; Mon, 06 May 2024 22:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 May 2024 02:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53749 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: pending patch Original-Received: via spool by 53749-submit@debbugs.gnu.org id=B53749.17150476388508 (code B ref 53749); Tue, 07 May 2024 02:08:01 +0000 Original-Received: (at 53749) by debbugs.gnu.org; 7 May 2024 02:07:18 +0000 Original-Received: from localhost ([127.0.0.1]:41459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4AEg-0002DA-3x for submit@debbugs.gnu.org; Mon, 06 May 2024 22:07:18 -0400 Original-Received: from forward502b.mail.yandex.net ([178.154.239.146]:38460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s4AEc-0002D4-Fm for 53749@debbugs.gnu.org; Mon, 06 May 2024 22:07:16 -0400 Original-Received: from mail-nwsmtp-smtp-production-main-90.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-90.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:2512:0:640:eb83:0]) by forward502b.mail.yandex.net (Yandex) with ESMTPS id EAF0E5E6C7; Tue, 7 May 2024 05:06:46 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-90.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id g6Nj1t5d4W20-lb5rIuPB; Tue, 07 May 2024 05:06:46 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1715047606; bh=9Ksac0fKc2s3Wn7rFf6ZVRcdfI5TVWhd6VhFtWeLdkc=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=YetryuFLTtI+wFtEHgcaFqREXpnFQXDtbfLwfkNKFM+hX5TNLMSuhyYRD3MaWWj1l FJcc/aJ9YqUTy46YPHYWD8stpSGM4dB+JoYq2AP3cONJgEJVH22AwCHyFOxmJ/VOoS gsT+naGFLD8gR+L0oH3g5kfVnWMrpRhPDVAAT8Ns= Authentication-Results: mail-nwsmtp-smtp-production-main-90.myt.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfauth.nyi.internal (Postfix) with ESMTP id 1D88F1200032; Mon, 6 May 2024 22:06:41 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 06 May 2024 22:06:42 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvjedgheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegughhuthhovheshigrnhguvgigrdhruheqnecuggftrfgrth htvghrnhepiefhjeeuveetffffvdefteffffekhfeuudejieehheeiudelgfehgffffedu ffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hguhhtohhvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqddufeeffeelleeh hedvqddvleegjeejjeejiedqughguhhtohhvpeephigrnhguvgigrdhruhesfhgrshhtmh grihhlrdgtohhm X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 May 2024 22:06:39 -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:284617 Archived-At: On 02/05/2024 16:32, David Fussner via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Hi Dmitry, > > Thanks for looking over the patch. Here's the recipe for the purported > bug in xref.el: > > 1. Please apply my patch to tex-mode.el (and xref.el). > > 2. I've attached xref-bug.zip, which contains a directory with 4 > identical LaTeX files and one LaTeX file with a single additional > character. Please extract it. > > 3. emacs -Q > > 4. C-x C-f xref-bug/mwea.ltx, and please don't visit the other 4 > files. > > 5. Put point on \__hook_debug:n in line 6. > > 6. M-?, RTN, ... RTN, RTN. > > The xref buffer should offer 5 hits, one from each file in the > directory. > > 7. Comment out the the line I added to xref--collect-matches, > byte-compile and load the file. > > 8. With point in the same place, M-?, RTN, ... RTN, RTN. > > The xref buffer should offer 3 hits. The first is from the > file-visiting buffer (where I also set syntax-propertize--done to 0, > because in my testing there could be some issues here, too). The > second hit is from the first file opened in *xref-temp. Here, > syntax-propertize runs to line-end, and all is well. The next two > files are missed, because syntax-propertize--done is set to line-end > and they have exactly the same line length as file two, and therefore > syntax-propertize thinks that's good enough and doesn't actually > change anything. The fifth file has an additional character in line 6, > so syntax-propertize decides it needs to work on this line because > line-end > syntax-propertize--done. > > You can put point on, say, \documentclass, and you'll get all 5 hits, > because this string doesn't begin or end with a non-word, non-symbol > character, and syntax-propertize doesn't need to run. You can make the > search string "\documentclass" and you'll get 2 hits, as line 1 has > the same length in all 5 files. (It's worth trying "\usepackage" as > the search string, too.) > > That's my diagnosis anyway. Does it make sense? Thank you, David, for the thorough scenario. I see the problem now.