GNU bug report logs - #48365
13.0.11; Dollars in distinct comments trigger math mode highlighting in text in-between

Previous Next

Package: auctex;

Reported by: jfbu <jfbu <at> free.fr>

Date: Tue, 11 May 2021 19:18:01 UTC

Severity: normal

Found in version 13.0.11

Done: Ikumi Keita <ikumi <at> ikumi.que.jp>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: jfbu <jfbu <at> free.fr>
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: Ikumi Keita <ikumi <at> ikumi.que.jp>, 48365 <at> debbugs.gnu.org
Subject: bug#48365: 13.0.11; Dollars in distinct comments trigger math mode highlighting in text in-between
Date: Wed, 12 May 2021 09:22:50 +0200
[Message part 1 (text/plain, inline)]
Hello Tassilo=Keita-san
Le 12 mai 2021 à 08:49, Tassilo Horn <tsdh <at> gnu.org> a écrit :

> Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
> 
> Hi Ikumi,
> 
>>> Would it make sense to apply these rules:
>> 
>>> 1. a $ in comments can never start math mode
>>> 2. but it can and will always stop math mode
>> 
>> That is a clean idea and, fortunately, easy to implment. Could you test
>> the attached patch?
> 
> I've committed a completely identical patch an hour ago with a diff just
> in the comment explaining what we are doing.  It's very encouraging when
> we both have the very same idea, so I think, it cannot be too wrong. :-)
> 
> Thanks,
> Tassilo

It is now revealed you are only one entity (perhaps an A.I. based
on quantum computing) pretending to be two humans only to
justify coverage of all time zones !

I have pulled the commit and it appears to work fine in my real-life
files (using doctex mode)

But I notice something weird when comparing effect on those two files

File A behaves as expected
% -*- 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
$
%
%

File B seems to have a problem
% -*- 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



In case of file B I was expecting the B line to be styled in math mode,
it only has its color it seems,
and I was not expecting \newcommand\foo to lose its highlighting,

Perhaps this is a symptom of something else?

Best,
Jean-François



[Message part 2 (text/html, inline)]
[Capture d’écran 2021-05-12 à 09.13.51.png (image/png, inline)]

This bug report was last modified 4 years and 73 days ago.

Previous Next


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