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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: "Paul D. Nelson" <ultrono <at> gmail.com>
Subject: bug#78585: closed (Re: bug#78585: [PATCH] TeX-fold-verbs: improve
 macro recognition)
Date: Tue, 27 May 2025 08:53:02 +0000
[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)]
From: Arash Esbati <arash <at> gnu.org>
To: "Paul D. Nelson" <ultrono <at> gmail.com>
Cc: 78585-done <at> debbugs.gnu.org
Subject: Re: bug#78585: [PATCH] TeX-fold-verbs: improve macro recognition
Date: Tue, 27 May 2025 10:52:21 +0200
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)]
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 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 22 days ago.

Previous Next


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