Subject: bug#48365: 13.0.11; Dollars in distinct comments trigger math mode highlighting in text in-between

From: jfbu <[email-masked]>
Date: Wed, 12 May 2021 23:08:37 +0200

Hi Keita-san
Le 12 mai 2021 à 19:04, Ikumi Keita <[email-masked]> a écrit :

>>>> % -*- mode: latex; -*-
>>>> %
>>>> \def\foo_with_underscore{}
>>>> \newcommand\foo{$}%$
>>>> % a comment
>>>> A foo_bar^bar{$}
>>>> % a comment
>>>> B foo_bar^bar{$}
>>>> % a comment
>>>> C foo_bar^bar
>>>> $
>>>> %
>>>> %
>>>> 
>>>> In case of file B, which differs only by an added %$ at end of the
>>>> \newcommand line, the \newcommand for example is not highlighted and
>>>> the B line changes colors without applying script style, see
>>>> screenshot
> 
> Fixed in the git repo. Please try.

Seems to work indeed
Somehow I have to hit C-cC-n to get fontification inclusive of subscripts getting lowered
to work after adding  a $ at the end of \newcommand\foo{$}%

% -*- mode: latex; -*-
%
\def\foo_with_underscore{}
\newcommand\foo{$}%
% a comment
A foo_bar^bar{$}
% a comment
B foo_bar^bar{$}
% a comment
C foo_bar^bar
$
%
%

but all looks fine to me. Thanks!
Jean-François