GNU bug report logs - #53749
29.0.50; [PATCH] Xref backend for TeX buffers

Previous Next

Package: emacs;

Reported by: David Fussner <dfussner <at> googlemail.com>

Date: Thu, 3 Feb 2022 15:10:02 UTC

Severity: normal

Tags: patch

Found in version 29.0.50

Fixed in version 31.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: David Fussner <dfussner <at> googlemail.com>
Cc: 53749 <at> debbugs.gnu.org, Ikumi Keita <ikumi <at> ikumi.que.jp>, Arash Esbati <arash <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>, Tassilo Horn <tsdh <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org>, stefankangas <at> gmail.com
Subject: bug#53749: 29.0.50; [PATCH] Xref backend for TeX buffers
Date: Tue, 7 May 2024 05:06:36 +0300
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.




This bug report was last modified 243 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.