GNU bug report logs -
#78585
[PATCH] TeX-fold-verbs: improve macro recognition
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Tue, 27 May 2025 10:52:21 +0200
with message-id <m2iklmzb96.fsf <at> macmutant.fritz.box>
and subject line Re: bug#78585: [PATCH] TeX-fold-verbs: improve macro recognition
has caused the debbugs.gnu.org bug report #78585,
regarding [PATCH] TeX-fold-verbs: improve macro recognition
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> 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)]
[Message part 3 (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)]
[Message part 5 (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
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.