GNU bug report logs - #78585
[PATCH] TeX-fold-verbs: improve macro recognition

Previous Next

Package: auctex;

Reported by: "Paul D. Nelson" <ultrono <at> gmail.com>

Date: Sun, 25 May 2025 12:54:02 UTC

Severity: normal

Tags: patch

Done: Arash Esbati <arash <at> gnu.org>

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Paul D. Nelson" <ultrono <at> gmail.com>
To: bug-auctex <at> gnu.org
Subject: [PATCH] TeX-fold-verbs: improve macro recognition
Date: Sun, 25 May 2025 14:52:58 +0200
[Message part 1 (text/plain, inline)]
Hi all,

This patch adds a couple "boundary checks" to the verbatim folding code
I contributed earlier.

Here's a sample document illustrating what could go wrong:

--8<---------------cut here---------------start------------->8---
\documentclass{article}
\usepackage{pythontex}
\NewDocumentCommand{\pyvm}{ m }{\mbox{\pyv{#1}}}

\begin{document}

$\pyvm{42}$

\end{document}
--8<---------------cut here---------------end--------------->8---

With the previous code, folding would trigger on \pyvm{42} as if it were
\pyv with delimiter m.  The fix is to require a word boundary in the
macro-matching regexp.

The other change is a bounds check.  I made this change locally a few
months ago, and think it was motivated by a parsing error, but
unfortunately forgot to save a minimal reproduction.

Any feedback welcome.

Thanks, best,

Paul

[0001-TeX-fold-verbs-improve-delimiter-and-macro-handling.patch (text/x-patch, attachment)]

This bug report was last modified 22 days ago.

Previous Next


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