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: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: David Fussner <dfussner <at> googlemail.com>
Cc: 53749 <at> debbugs.gnu.org, Ikumi Keita <ikumi <at> ikumi.que.jp>, Dmitry Gutov <dmitry <at> gutov.dev>, Arash Esbati <arash <at> gnu.org>, Stefan Kangas <stefankangas <at> gmail.com>, Tassilo Horn <tsdh <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#53749: 29.0.50; [PATCH] Xref backend for TeX buffers
Date: Sat, 14 Sep 2024 19:26:07 +0200
Thanks for the contribution, David! My electronic servant complained about some regexps:

3881    (re-search-backward (concat "[]["
3882                                (mapconcat #'regexp-quote
3883                                           (mapcar #'char-to-string
3884                                                   tex-thingatpt-exclude-chars))
3885                                "\"*`'#=&()%,|$[:cntrl:][:blank:]]"))

This is not a correct way to build a regexp; `regexp-quote` can only be used to quote strings that should match literally, not characters inside [...], where backslashes have no escaping power.

There are various ways of doing this properly. I would suggest something like

  (rx-to-string `(or (in "\"#$%&'()*,=[]`|" cntrl blank)
                     ,@tex-thingatpt-exclude-chars)
                t))

but it also depends on what you want that `tex-thingatpt-exclude-chars` variable to be. Should it be a user option (defcustom)? The variable's doc string is a wall of text that basically says that it can be set to whatever you want but things will stop working so you'd better not.





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.