GNU bug report logs - #78696
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, #78698; dated Wed, 4 Jun 2025 17:41: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; 4 Jun 2025 23:40:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 04 19:40:32 2025
Received: from localhost ([127.0.0.1]:54844 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uMxii-0002Xm-G5
	for submit <at> debbugs.gnu.org; Wed, 04 Jun 2025 19:40:32 -0400
Received: from lists.gnu.org ([2001:470:142::17]:46704)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ultrono@HIDDEN>) id 1uMxig-0002X5-OR
 for submit <at> debbugs.gnu.org; Wed, 04 Jun 2025 19:40:31 -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 <ultrono@HIDDEN>) id 1uMxiX-00015a-E2
 for bug-auctex@HIDDEN; Wed, 04 Jun 2025 19:40:21 -0400
Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ultrono@HIDDEN>) id 1uMxiW-0005x9-0H
 for bug-auctex@HIDDEN; Wed, 04 Jun 2025 19:40:21 -0400
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-5533303070cso375014e87.2
 for <bug-auctex@HIDDEN>; Wed, 04 Jun 2025 16:40:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1749080418; x=1749685218; darn=gnu.org;
 h=mime-version:message-id:date:in-reply-to:subject:cc:to:from:from:to
 :cc:subject:date:message-id:reply-to;
 bh=ASfNZ9Etb6VZxpk/+E/TG0xqBGvM8YgwAHN90wBJGDE=;
 b=IjdVHAZxnCFchnn3qflUZC1BAGybewWDz+qWxPpYVbC0F7P6+k042uioPC/z/+Koi9
 vdri04S/GfejEeOnw6VoeQqQRPr6A+vgPMkxmKTKtQ63l9mx0SN4SNKdq2j42hTnuCp6
 v7K7YTLFqOpw+sV4T5gLtVCiUSYITZCMdBqekfSNnN/PHf926ZKXEdc1Yz8TYI79UuL2
 5LBOH/erVRl7zlH1pkNg/uH/3i7N8pSbzYRI1nwZTb2EI6rM86y4ZyVdmDLeUGFVC0+V
 MoHYIUGcHI3wPS8y+czoqclzNu3sgAbBRSM0P60IUlf1o5qDN+WyFRN0XRMyPW2wsEAN
 A1FA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1749080418; x=1749685218;
 h=mime-version:message-id:date:in-reply-to:subject:cc:to:from
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=ASfNZ9Etb6VZxpk/+E/TG0xqBGvM8YgwAHN90wBJGDE=;
 b=Lw+RtzVyf5+mxE5rQg70+DOf9ieRDmFo5vpRYIr9Jz9bfM/N5PqEQzy2JJTpBcRI7W
 lP7kEqkZ9m7TzKxojCW82T+VI4XBr+0CMK9KxSY2S2moWv6jXmSGVxCQKKbIQIYQtG1w
 CgnSjckss3sUPQj0UcIz+mw/S00xIuM9cAtS8GAOvgUBbZfX1uAwnn8bmtW5TrdOysk7
 b9IsmOorm96BoAya8VTsaq13WShMeMKNLQHhSNjnSd0psnaD3zwYFyqtqMCsnFSAM3Mr
 aRCgmvb/C3SJ8VB8nkvStcw4HwWznQuZUaXu9b0EoJ6QyJlgU3LgHicc++wPl56XoS6r
 6wyQ==
X-Gm-Message-State: AOJu0Yx/qvDeb6OVkJNH0dK6NMnwqXeZ+dq+HBHGoN/V+M6rsJnQe5mz
 HuiNf9+tkDGJl0KS0lvO1GlwYmMv/P+cOB/BbEDbu8ooZkHmwNqEuIGpuR50auwK3Fc=
X-Gm-Gg: ASbGncsSqNUtg+l2b2m+kidpnJx6DFgbsf/z5dqqQFmMijEQRvouVoJ7owB8YcHMo4q
 Nd1Diavcr/X6R7UqR0Kf0pOoMhhH38jgOGu5yBRoJsbrcEq6bxue2f3dO2i1iIzwUTW9hcokQG4
 rpUx0re60wqOo/cWMJ+hFe8KNf8wqwOkFwOCO2jp9MmIx7Sl3H/KsAhDKVq741qoNf0P1jy+CmC
 rsuigCGdLih860fIK/35hMzRkaNdjwg8PkGZMP2S6Gaicxt+OleN8zT46ElBNdRGMKu5oE9DjLl
 kpkPrrMnVrQ2C/utbzfTO0tsLvz2gFxl9Lj8aQNAAYAj/HMQL+lIKw95OGT2d6yC+T66A1HJNGN
 MlwspIw71KKMotWax5J81Tw==
X-Google-Smtp-Source: AGHT+IGIR+VS4BmOe0Qev3tlrFULLt5u5JTlhhvYXdedvU8IkwSYfRNpxkL5Awh9JipAhBiSBkT7tA==
X-Received: by 2002:a05:6512:3e06:b0:553:34b7:5731 with SMTP id
 2adb3069b0e04-55356adf994mr1492464e87.3.1749080417682; 
 Wed, 04 Jun 2025 16:40:17 -0700 (PDT)
Received: from localhost (static-212-247-159-249.cust.tele2.se.
 [212.247.159.249]) by smtp.gmail.com with UTF8SMTPSA id
 2adb3069b0e04-553378a156csm2458477e87.69.2025.06.04.16.40.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 04 Jun 2025 16:40:17 -0700 (PDT)
From: "Paul D. Nelson" <ultrono@HIDDEN>
To: Rahguzar <rahguzar@HIDDEN>
Subject: Re: 14.0.9; Folding of math macros with a function spec is broken
In-Reply-To: <87cybjl81u.fsf@HIDDEN> (message from Rahguzar on Wed, 04
 Jun 2025 22:40:13 +0500)
Date: Thu, 05 Jun 2025 01:40:14 +0200
Message-ID: <uxsg7tqzzzulcx.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2a00:1450:4864:20::130;
 envelope-from=ultrono@HIDDEN; helo=mail-lf1-x130.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, 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 (/)

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.

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?

Paul




Information forwarded to bug-auctex@HIDDEN:
bug#78696; Package auctex. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 4 Jun 2025 17:40:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jun 04 13:40:35 2025
Received: from localhost ([127.0.0.1]:51969 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uMs6M-0003Vi-Ah
	for submit <at> debbugs.gnu.org; Wed, 04 Jun 2025 13:40:35 -0400
Received: from lists.gnu.org ([2001:470:142::17]:55376)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <rahguzar@HIDDEN>)
 id 1uMs6I-0003Te-8f
 for submit <at> debbugs.gnu.org; Wed, 04 Jun 2025 13:40:33 -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 1uMs6B-0003un-0B
 for bug-auctex@HIDDEN; Wed, 04 Jun 2025 13:40:23 -0400
Received: from mout-p-102.mailbox.org ([80.241.56.152])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <rahguzar@HIDDEN>)
 id 1uMs69-0003iX-3s
 for bug-auctex@HIDDEN; Wed, 04 Jun 2025 13:40:22 -0400
Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202])
 (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-102.mailbox.org (Postfix) with ESMTPS id 4bCFGS6bqGz9tq8;
 Wed,  4 Jun 2025 19:40:16 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org;
 s=mail20150812; t=1749058816;
 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=SuVfprvY/1rmZhEcxoOMkOHz0aSUC8PGZeWh6PqNF3Q=;
 b=xA/X2XQQrr/cDR+1+XWP+K5w/FU4SKa6drwA52I5ml2Ld7k0KnNkH6d1SQBvKervnjGB/u
 bwT5gB4ZD7bfs0iydhx+r3FAEa1QkO+8ER47fWHuNmiuEPcsTj1Fn9eM23qoS/JsRn+gSg
 jkJoZvCK+YhKLzCW0IqqEWeifLF/5FAJyCZgVLHOyhwF5jWEFJtAvzF1hkT/LM0W4braXz
 CqgINrOLLsflnQ/GnJhrdpc2xtNJkYcuZW0mn4PD5/+VAQabddNZM6LukuXYy2Ljhu6um/
 /QRzVmdPeT99MsFt31ToBLk4gKtl3StNgchK+1xIjS/MHUVxPCeyjEEYNBKjNg==
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: <uxsg7tzfenvluf.fsf@HIDDEN> (Paul D. Nelson's message of "Wed, 
 04 Jun 2025 12:32:08 +0200")
References: <uxsg7tzfenvluf.fsf@HIDDEN>
Date: Wed, 04 Jun 2025 22:40:13 +0500
Message-ID: <87cybjl81u.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-MBO-RS-ID: 116b1b6be952ec9ea1a
X-MBO-RS-META: zfhun1u7idddcw441nimrn3t4mpmwntm
Received-SPF: pass client-ip=80.241.56.152; envelope-from=rahguzar@HIDDEN;
 helo=mout-p-102.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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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 (/)

Hi Paul,

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

> Thanks Raghuzar.  The issue is the result of this change:
>
> --8<---------------cut here---------------start------------->8---
> diff --git a/tex-fold.el b/tex-fold.el
> index 766270ef..78e5b822 100644
> --- a/tex-fold.el
> +++ b/tex-fold.el
> @@ -901,6 +901,12 @@ TYPE can be either `env' for environments, `macro' for macros or
>             (goto-char (1+ start))
>             (LaTeX-find-matching-end)
>             (point))
> +          ((eq type 'math)
> +           (goto-char (1+ start))
> +           (if (zerop (skip-chars-forward "A-Za-z@"))
> +               (forward-char)
> +             (skip-chars-forward "*"))
> +           (point))
>            (t
>             (goto-char start)
>             (TeX-find-macro-end)))))
> --8<---------------cut here---------------end--------------->8---
>
> The intent here was that "math macros" built-in to tex-fold don't take
> arguments, but this is not the case for the custom one you provide.
>
>> (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?

> Paul




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#78696; 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.