Subject: bug#35284: 12.1.1; new verbatim environment wrongly commented out

From: JF <[email-masked]>
Date: Tue, 16 Apr 2019 14:56:46 +0200

Hi Keita,

Le 16/04/2019 à 14:47, Ikumi Keita a écrit :
> Hi Jean,
>
>>>>>> jfbu <[email-masked]> writes:
>> But isn't there a bug even for the use case one wants the verbatim to
>> be inserted inside the comment?
>> (which wasn't my case)
>> Look at commented out last line, and at the added blank line.
>> \documentclass{article}
>> \begin{document}
>> % \begin{verbatim}
>> % This is a comment
>> \def\foo#1{foo}
>> % another comment
>> % \end{verbatim}
>> % \end{document}
> Thanks for your comments.  I agree that the current behavior is not
> totally satisfactory, and expect the attatched patch would crudely
> resolve this particular issue.  However, the relevant codes must be
> involved in a lot, lot of different cases, so it might not be valid for
> some other cases.  I'm not sure currently.

I have added the patch to my current auctex 12.1.1 and it does improve the situation.
as it produces

\begin{document}
% \begin{verbatim}
% This is a comment
\def\foo#1{foo}
% another comment
% \end{verbatim}
%
\end{document}

which avoids a blank line insertion and does not comment out the next line
(which here is the \end{document} one)

Best,

Jean-François

> Regards,
> Ikumi Keita