GNU bug report logs - #78588
[PATCH] Fix math macro folding to not consume subsequent brackets

Previous Next

Package: auctex;

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

Date: Sun, 25 May 2025 15:56:01 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: Arash Esbati <arash <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#78588: closed ([PATCH] Fix math macro folding to not consume
 subsequent brackets)
Date: Fri, 30 May 2025 15:22:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 30 May 2025 17:21:04 +0200
with message-id <m2y0uef7kv.fsf <at> macmutant.fritz.box>
and subject line Re: bug#78588: [PATCH] Fix math macro folding to not consume subsequent brackets
has caused the debbugs.gnu.org bug report #78588,
regarding [PATCH] Fix math macro folding to not consume subsequent brackets
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
78588: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78588
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: "Paul D. Nelson" <ultrono <at> gmail.com>
To: bug-auctex <at> gnu.org
Subject: [PATCH] Fix math macro folding to not consume subsequent brackets
Date: Sun, 25 May 2025 17:55:05 +0200
[Message part 3 (text/plain, inline)]
Hi again,

Folding $x \in [0,1]$ doesn't work as intended: [0,1] gets folded as if it
were an optional argument to \in.

The issue is that, when called on 'math macros, TeX-fold-item-end calls
TeX-find-macro, which skips past any {...} or [...].

The attached patch makes an expection in TeX-fold-item-end for 'math
macros, so that only the macro name itself (e.g., "\in") is folded.

This only affects the folding of macros in the list
TeX-fold-math-spec-list-internal, and looking through that list, I
didn't spot any for which this change would have an undesired effect.

Any feedback welcome.

Thanks, best,

Paul

[0001-Fix-math-macro-folding-to-not-consume-subsequent-bra.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Arash Esbati <arash <at> gnu.org>
To: "Paul D. Nelson" <ultrono <at> gmail.com>
Cc: 78588-done <at> debbugs.gnu.org
Subject: Re: bug#78588: [PATCH] Fix math macro folding to not consume
 subsequent brackets
Date: Fri, 30 May 2025 17:21:04 +0200
"Paul D. Nelson" <ultrono <at> gmail.com> writes:

> Folding $x \in [0,1]$ doesn't work as intended: [0,1] gets folded as if it
> were an optional argument to \in.
>
> The issue is that, when called on 'math macros, TeX-fold-item-end calls
> TeX-find-macro, which skips past any {...} or [...].
>
> The attached patch makes an expection in TeX-fold-item-end for 'math
> macros, so that only the macro name itself (e.g., "\in") is folded.
>
> This only affects the folding of macros in the list
> TeX-fold-math-spec-list-internal, and looking through that list, I
> didn't spot any for which this change would have an undesired effect.

I installed that change.  Again, many thanks, closing.

Best, Arash


This bug report was last modified 16 days ago.

Previous Next


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