GNU bug report logs - #78698
14.0.9; Folding of math macros with a function spec is broken

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: auctex; Reported by: Rahguzar <rahguzar@HIDDEN>; merged with #78693, #78696; dated Thu, 5 Jun 2025 03:55:01 UTC; Maintainer for auctex is bug-auctex@HIDDEN.
Forcibly Merged 78693 78696 78698. Request was from Arash Esbati <arash@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Jun 2025 03:54:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 04 23:54:54 2025
Received: from localhost ([127.0.0.1]:56749 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uN1gq-0004Hn-V4
	for submit <at> debbugs.gnu.org; Wed, 04 Jun 2025 23:54:54 -0400
Received: from lists.gnu.org ([2001:470:142::17]:60572)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <rahguzar@HIDDEN>)
 id 1uN1gn-0004H0-Uq
 for submit <at> debbugs.gnu.org; Wed, 04 Jun 2025 23:54:50 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rahguzar@HIDDEN>)
 id 1uN1gh-0000zm-9F
 for bug-auctex@HIDDEN; Wed, 04 Jun 2025 23:54:43 -0400
Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <rahguzar@HIDDEN>)
 id 1uN1gd-0004KO-7L
 for bug-auctex@HIDDEN; Wed, 04 Jun 2025 23:54:40 -0400
Received: from smtp102.mailbox.org (smtp102.mailbox.org
 [IPv6:2001:67c:2050:b231:465::102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4bCVvB07f4z9ssx;
 Thu,  5 Jun 2025 05:54:30 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org;
 s=mail20150812; t=1749095670;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=zlJc5R/LRAnlC53mv1ymn9YWgmNHxa2CTER3lwGv2HU=;
 b=qH9Y63QAY7SCfZ15cqlWY1MOT+QH2xho8PqJBEqy6je7WAXG8k7U7ObUpN5bsFzhngdUj6
 f5MmUCpxXqcCqUMdYNeAqGVQLSf4Vq8haGTzKjuB2K8uC62+daIs4gWBr/UkCKWIqKos+E
 0b6C4EknMEuptkBp2aCooQnNsp0rVhDTFiaaVx+h3ufe5+/w1NNPo/GvqFICuWbXCZH6NP
 SxChvTniWWhkMZXj7gHHVLnIRGqL/58wmiytiLLJLnmJ2ZXdrZ7ACQyRgzVK5z9y+IuJ4s
 GnDzFN4yNuTsXeo4nkXhSs3A+rZbxRP0ekkZlVJRQ2s2m5HVzmDPMaJI3e+Tjw==
From: Rahguzar <rahguzar@HIDDEN>
To: "Paul D. Nelson" <ultrono@HIDDEN>
Subject: Re: 14.0.9; Folding of math macros with a function spec is broken
In-Reply-To: <uxsg7tqzzzulcx.fsf@HIDDEN> (Paul D. Nelson's message of "Thu, 
 05 Jun 2025 01:40:14 +0200")
References: <uxsg7tqzzzulcx.fsf@HIDDEN>
Date: Thu, 05 Jun 2025 08:54:26 +0500
Message-ID: <877c1qlu6l.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-MBO-RS-META: sacin878f3kpt9mrck9h6m1m8scuih9w
X-MBO-RS-ID: f0c276007820de0e3ba
Received-SPF: pass client-ip=2001:67c:2050:0:465::101;
 envelope-from=rahguzar@HIDDEN; helo=mout-p-101.mailbox.org
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: bug-auctex@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

"Paul D. Nelson" <ultrono@HIDDEN> writes:

> Hi Rahguzar,
>
>>>> (setq TeX-fold-math-spec-list `((,(lambda (text) (propertize text 'face '(underline))) ("underline"))))
>>>
>>> Is there a reason to prefer this vs. the same with
>>> TeX-fold-macro-spec-list in place of TeX-fold-math-spec-list?
>>
>> The reason for why it is in TeX-fold-math-spec-list is that when I
>> started with Emacs I stole it from Tecosaur's config. There are quite a
>> few function specs in my TeX-fold-math-spec-list e.g. for sqrt, frac,
>> mathcal, mathfrak and mathbb etc and most of them are relevant only for
>> math. Should they be moved to TeX-fold-macro-spec-list?
>
> I think one can use TeX-fold-macro-spec-list for all of these.  In
> particular, your underline example works fine there for me.
>
> It's not clear to me from those what exactly are the intended purposes
> of the various spec lists (macro/env/math).  My impression from the
> built-in examples was that the math list is for macros like "alpha" that
> accept no arguments.

Yes, it would be good to make this clear in the documentation.

> The motivation for the offending patch was to make it so folding "\in
> [0, 1]" doesn't hide the "[0, 1]" as if it were an optional arg.  To
> give a more robust fix that works with your code sample, we would need a
> more robust way to detect when a macro is not intended to have any
> (optional) arguments.  The implemented approach was to just assume that
> all the "math" macros accept no arguments.  Do you or does anyone have
> other suggestions?

I have also seen the problem you are encountering so it is good to
have a fix for that.

I think to preserve breakage and preserve backward compatibility it
would be better to either:

1) Assume that there is no white-space between the macro name and the
brackets enclosing the arguments. This is probably not how TeX syntax
works but I think (not too sure about this) it is the usual style. This
behavior can be controlled by a custom variable.

2) Since the problem is with optional arguments we can allow { after the
macro name but not [.

3) Another option can be to introduce a new spec alist for macros
without optional args.

> Paul

Rahguzar




Acknowledgement sent to Rahguzar <rahguzar@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-auctex@HIDDEN. Full text available.
Report forwarded to bug-auctex@HIDDEN:
bug#78698; Package auctex. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 11 Jun 2025 07:45:01 UTC

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