Subject: Re: bug#31722: 12.1.1; TeX Fold fontification problem

From: Arash Esbati <[email-masked]>
Date: Mon, 04 Mar 2024 23:39:28 +0100

Arash Esbati <[email-masked]> writes:

> Marco Falconi <[email-masked]> writes:
>
>> I have a custom definition of math macros to be folded. It is the
>> following (taken from .emacs in the customize part, I have set it
>> using customize):
>>
>> '(LaTeX-fold-math-spec-list
>>    (quote
>>     (("[{1}/{2}]"
>>       ("frac" "tfrac"))
>>      ("[{1}⇣{2}]"
>>       ("underset"))
>>      ("[{1}⇡{2}]"
>>       ("overset"))
>>      ("︷[{1}]"
>>       ("underbrace"))
>>      ("√[{1}]"
>>       ("sqrt")))))
>>
>> In the ones with two arguments (frac, tfrac, underset, overset), the
>> first argument gets fontified in the folded string, but the second one
>> is not fontified (in the unfolded string, everything is fontified
>> correctly). This macro for example has such behavior:
>>
>> \underset{\hslash\to 0}{ \longrightarrow}
>>
>> The macros with just one argument are fontified correctly also when folded.
>
> Hi Marco,
>
> I can't reproduce what you're describing.  For me, a minimal .tex file
> looks like this:
>
> x
>
>
> Here is the code of the file:
>
> \documentclass[10pt]{article}
>
> \usepackage{amsmath}
>
> \begin{document}
>
> \begin{verbatim}
> (setq LaTeX-fold-math-spec-list
>       (append '(("[{1}/{2}]"
>                  ("frac" "tfrac"))
>                 ("[{1}⇣{2}]"
>                  ("underset"))
>                 ("[{1}⇡{2}]"
>                  ("overset"))
>                 ("√[{1}]"
>                  ("sqrt")))
>               LaTeX-fold-math-spec-list))
> \end{verbatim}
>
> $\frac{1}{2} \tfrac{1}{2} \overset{1}{2}
> \underset{\hslash\to 0}{ \longrightarrow}
> \sqrt{9}$
>
> \end{document}
>
> What I did was:
> 1) Open a new tex file
> 2) Eval the setq form (put cursor after the last parenthesis and hit
> `C-x C-e'
> 3) Hitting `M-x TeX-fold-mode RET' and `C-c C-o C-b'.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

More information was requested which was not provided.  Therefore I'm
closing this report.

Best, Arash