GNU bug report logs -
#78585
[PATCH] TeX-fold-verbs: improve macro recognition
Previous Next
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>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#78585: [PATCH] TeX-fold-verbs: improve macro recognition
which was filed against the auctex package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 78585 <at> debbugs.gnu.org.
--
78585: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78585
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Hi Paul,
"Paul D. Nelson" <ultrono <at> gmail.com> writes:
> I had in mind stuff like:
>
> (string-match "\\\\verb\\*\\_>" "\\verb*") ; t
> (string-match "\\\\verb\\*\\>" "\\verb*") ; nil
> (string-match "\\\\verb\\*\b" "\\verb*") ; nil
>
> (I'll confess that I am not too familiar with what sorts of verbatim
> macro names are out there, but figured ending on a symbol boundary would
> be relatively safe.)
Ah, yes, thanks, there are also starred versions. I installed your
patch and therefore closing this report. Thanks again for your
contribution.
Best, Arash
[Message part 3 (message/rfc822, inline)]
[Message part 4 (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 52 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.