GNU bug report logs - #35284
12.1.1; new verbatim environment wrongly commented out

Previous Next

Package: auctex;

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

Date: Mon, 15 Apr 2019 09:12:02 UTC

Severity: normal

Tags: fixed

Found in version 12.1.1

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35284 in the body.
You can then email your comments to 35284 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-auctex <at> gnu.org:
bug#35284; Package auctex. (Mon, 15 Apr 2019 09:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to jfbu <jfbu <at> free.fr>:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Mon, 15 Apr 2019 09:12:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: jfbu <jfbu <at> free.fr>
To: bug-auctex <at> gnu.org
Subject: 12.1.1; new verbatim environment wrongly commented out
Date: Mon, 15 Apr 2019 11:11:23 +0200
Emacs  : GNU Emacs 26.1 (build 1, x86_64-apple-darwin13.4.0, Carbon Version 157 AppKit 1265.21)
 of 2018-06-18
Package: 12.1.1

(my elpa has some patches I think from git repo, but they should not affect this)

Consider this source

\documentclass{article}

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

Select the three lines delimited by the document environment

Hit C-cC-e verbatim

Result:

\documentclass{article}

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

% \end{verbatim}
% \end{document}

Regards,

Jean-François



Information forwarded to bug-auctex <at> gnu.org:
bug#35284; Package auctex. (Mon, 15 Apr 2019 14:49:02 GMT) Full text and rfc822 format available.

Message #8 received at 35284 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: jfbu <jfbu <at> free.fr>
Cc: 35284 <at> debbugs.gnu.org
Subject: Re: bug#35284: 12.1.1; new verbatim environment wrongly commented out
Date: Mon, 15 Apr 2019 23:48:34 +0900
Hi Jean,

Please consider customizing the option `LaTeX-insert-into-comments'.
You will get
\documentclass{article}

\begin{document}
\begin{verbatim}
% This is a comment
\def\foo#1{foo}
% another comment
\end{verbatim}
\end{document}
after the option is set to nil.

Regards,
Ikumi Keita

>>>>> jfbu <jfbu <at> free.fr> writes:
> Consider this source

> \documentclass{article}

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

> Select the three lines delimited by the document environment

> Hit C-cC-e verbatim

> Result:

> \documentclass{article}

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

> % \end{verbatim}
> % \end{document}




Information forwarded to bug-auctex <at> gnu.org:
bug#35284; Package auctex. (Mon, 15 Apr 2019 14:58:02 GMT) Full text and rfc822 format available.

Message #11 received at 35284 <at> debbugs.gnu.org (full text, mbox):

From: jfbu <jfbu <at> free.fr>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: 35284 <at> debbugs.gnu.org
Subject: Re: bug#35284: 12.1.1; new verbatim environment wrongly commented out
Date: Mon, 15 Apr 2019 16:57:09 +0200
Hi Keita,

Thanks.

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}


To be more precise I type

C-cC-e and then verbatim and Return

after having selected with the mouse 3 lines, and the cursor blinks at start of \end{document}

Best,

Jean-François


Le 15 avr. 2019 à 16:48, Ikumi Keita <ikumi <at> ikumi.que.jp> a écrit :

> Hi Jean,
> 
> Please consider customizing the option `LaTeX-insert-into-comments'.
> You will get
> \documentclass{article}
> 
> \begin{document}
> \begin{verbatim}
> % This is a comment
> \def\foo#1{foo}
> % another comment
> \end{verbatim}
> \end{document}
> after the option is set to nil.
> 
> Regards,
> Ikumi Keita
> 
>>>>>> jfbu <jfbu <at> free.fr> writes:
>> Consider this source
> 
>> \documentclass{article}
> 
>> \begin{document}
>> % This is a comment
>> \def\foo#1{foo}
>> % another comment
>> \end{document}
> 
>> Select the three lines delimited by the document environment
> 
>> Hit C-cC-e verbatim
> 
>> Result:
> 
>> \documentclass{article}
> 
>> \begin{document}
>> % \begin{verbatim}
>> % This is a comment
>> \def\foo#1{foo}
>> % another comment
> 
>> % \end{verbatim}
>> % \end{document}





Information forwarded to bug-auctex <at> gnu.org:
bug#35284; Package auctex. (Tue, 16 Apr 2019 12:48:02 GMT) Full text and rfc822 format available.

Message #14 received at 35284 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: jfbu <jfbu <at> free.fr>
Cc: 35284 <at> debbugs.gnu.org
Subject: Re: bug#35284: 12.1.1; new verbatim environment wrongly commented out
Date: Tue, 16 Apr 2019 21:47:19 +0900
[Message part 1 (text/plain, inline)]
Hi Jean,

>>>>> jfbu <jfbu <at> free.fr> 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.

Regards,
Ikumi Keita

[patch-insert-environment (text/x-diff, attachment)]

Information forwarded to bug-auctex <at> gnu.org:
bug#35284; Package auctex. (Tue, 16 Apr 2019 12:57:01 GMT) Full text and rfc822 format available.

Message #17 received at 35284 <at> debbugs.gnu.org (full text, mbox):

From: JF <jfbu <at> free.fr>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: 35284 <at> debbugs.gnu.org
Subject: Re: bug#35284: 12.1.1; new verbatim environment wrongly commented out
Date: Tue, 16 Apr 2019 14:56:46 +0200
Hi Keita,

Le 16/04/2019 à 14:47, Ikumi Keita a écrit :
> Hi Jean,
>
>>>>>> jfbu <jfbu <at> free.fr> 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
>





Information forwarded to bug-auctex <at> gnu.org:
bug#35284; Package auctex. (Tue, 16 Apr 2019 13:02:02 GMT) Full text and rfc822 format available.

Message #20 received at 35284 <at> debbugs.gnu.org (full text, mbox):

From: gojjoe <at> gmail.com
To: Ikumi Keita <ikumi <at> ikumi.que.jp>, jfbu <jfbu <at> free.fr>
Cc: 35284 <at> debbugs.gnu.org
Subject: Re: bug#35284: 12.1.1; new verbatim environment wrongly commented out
Date: Tue, 16 Apr 2019 15:01:07 +0200
Is this possibly connected with the small bug that I reported a while ago?

I enclose the text of my old report:

---------------------

I've noticed a little bug when auto-fill operates on a line finishing with a "%". To reproduce:

1. Activate auto-fill-mode in a tex file with LaTeX mode.

2. Set fill-column to some value; here I use 20.

3. Suppose you have a line like this:

123456789% commented

4. Now you'd like to add some more text right before the "%", eg "-1234567890 abc".

Note that "123456789-1234567890" is twenty characters long, so auto-fill should automatically insert a newline as we type the space after "0". Expected result:

123456789-1234567890
abc% commented


Instead I get this:

123456789-1234567890
% abccommented

That is, my text has been continued  *within* the comment, which wasn't my intention


– Further info:

A. If the text before the comment is *already longer* than auto-fill-column when I type the space, and if auto-fill can carry some previous text to the new line, then everything works correctly. For example, If I have

123456789% commented

And now I type " 1234567890X abc" (note: space instead of "-") right before the "%", I get

123456789
1234567890X abc% commented

as desired.

B. The length of the text after "%" seems to be irrelevant for the issue.

----------------------

On 19-04-16 14:47, Ikumi Keita wrote:
> 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.




Information forwarded to bug-auctex <at> gnu.org:
bug#35284; Package auctex. (Wed, 17 Apr 2019 06:36:02 GMT) Full text and rfc822 format available.

Message #23 received at 35284 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: gojjoe <at> gmail.com
Cc: 35284 <at> debbugs.gnu.org, jfbu <jfbu <at> free.fr>
Subject: Re: bug#35284: 12.1.1; new verbatim environment wrongly commented out
Date: Wed, 17 Apr 2019 15:35:08 +0900
Hi,

>>>>> gojjoe <at> gmail.com writes:
> Is this possibly connected with the small bug that I reported a while ago?

It doesn't seem so.  AUCTeX does nothing special at auto fill in LaTeX
mode and leave it to `do-auto-fill', the default auto fill function of
emacs.  It's rather complicated and would be somewhat hard to fix.

Regards,
Ikumi Keita




Information forwarded to bug-auctex <at> gnu.org:
bug#35284; Package auctex. (Mon, 23 Dec 2019 16:21:02 GMT) Full text and rfc822 format available.

Message #26 received at 35284 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Denis Bitouzé <denis.bitouze <at> univ-littoral.fr>
Cc: auctex <at> gnu.org, 35284 <at> debbugs.gnu.org, jfbu <jfbu <at> free.fr>
Subject: Re: Empty line after an environment & bug#35284: 12.1.1;
 new verbatim environment wrongly commented out
Date: Tue, 24 Dec 2019 01:20:40 +0900
[Message part 1 (text/plain, inline)]
Hi Denis, Jean, sorry for very late response.

Each of you reported[1][2] about unsatisfactory results of
`LaTeX-insert-environmnt' (i.e., C-c C-e) before.

After taking a bit close look at the code, I came to think that the
management of the positions of the point and the mark in that function
is insufficient.  I expect the attached patch fixes the both problems.

Denis and Jean, could you please check it works on your side well? (To
Jean: revert my premature patch[3] befor trying it out)

Best regards,
Ikumi Keita

[1] https://lists.gnu.org/archive/html/auctex/2019-11/msg00009.html
[2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35284
[3] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35284#14

[fix-for-LaTeX-insert-environment (text/x-diff, attachment)]

Information forwarded to bug-auctex <at> gnu.org:
bug#35284; Package auctex. (Tue, 24 Dec 2019 16:14:01 GMT) Full text and rfc822 format available.

Message #29 received at 35284 <at> debbugs.gnu.org (full text, mbox):

From: Denis Bitouzé <denis.bitouze <at> univ-littoral.fr>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: auctex <at> gnu.org,
 Denis Bitouzé <denis.bitouze <at> univ-littoral.fr>,
 35284 <at> debbugs.gnu.org, jfbu <jfbu <at> free.fr>
Subject: Re: Empty line after an environment & bug#35284: 12.1.1;
 new verbatim environment wrongly commented out
Date: Tue, 24 Dec 2019 17:13:19 +0100
Le 24/12/19 à 01h20, Ikumi Keita a écrit :

> Hi Denis, Jean, sorry for very late response.

Hi Ikumi and Jean(-François),

> Each of you reported[1][2] about unsatisfactory results of
> `LaTeX-insert-environmnt' (i.e., C-c C-e) before.

I wasn't aware of the Jean-François's bug report. Sorry for the
duplicate.

> After taking a bit close look at the code, I came to think that the
> management of the positions of the point and the mark in that function
> is insufficient.  I expect the attached patch fixes the both problems.
>
> Denis and Jean, could you please check it works on your side well? (To
> Jean: revert my premature patch[3] befor trying it out)

It works nicely, many thanks!

Best regards.
-- 
Denis




Information forwarded to bug-auctex <at> gnu.org:
bug#35284; Package auctex. (Wed, 25 Dec 2019 15:16:01 GMT) Full text and rfc822 format available.

Message #32 received at 35284 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Denis Bitouzé <denis.bitouze <at> univ-littoral.fr>
Cc: auctex <at> gnu.org, 35284 <at> debbugs.gnu.org, jfbu <jfbu <at> free.fr>
Subject: Re: Empty line after an environment & bug#35284: 12.1.1;
 new verbatim environment wrongly commented out
Date: Thu, 26 Dec 2019 00:14:59 +0900
>>>>> Denis Bitouzé <denis.bitouze <at> univ-littoral.fr> writes:
> I wasn't aware of the Jean-François's bug report. Sorry for the
> duplicate.

No problem :-).

>> Denis and Jean, could you please check it works on your side well? (To
>> Jean: revert my premature patch[3] befor trying it out)

> It works nicely, many thanks!

Thank you for confirmation.  I'll wait for Jean's response.

Regards,
Ikumi Keita




Information forwarded to bug-auctex <at> gnu.org:
bug#35284; Package auctex. (Tue, 31 Dec 2019 02:51:01 GMT) Full text and rfc822 format available.

Message #35 received at 35284 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: auctex <at> gnu.org
Cc: Denis Bitouzé <denis.bitouze <at> univ-littoral.fr>,
 35284 <at> debbugs.gnu.org, jfbu <jfbu <at> free.fr>
Subject: Re: Empty line after an environment & bug#35284: 12.1.1;
 new verbatim environment wrongly commented out
Date: Tue, 31 Dec 2019 11:50:12 +0900
Hi all,

>>>>> Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
>>> Denis and Jean, could you please check it works on your side well? (To
>>> Jean: revert my premature patch[3] befor trying it out)

>> It works nicely, many thanks!

> Thank you for confirmation.  I'll wait for Jean's response.

Though I haven't heard from Jean yet, I committed the fix to the git
repo with regression test.  Please let me know if it causes any bad
side effect.

Regards,
Ikumi Keita




Information forwarded to bug-auctex <at> gnu.org:
bug#35284; Package auctex. (Wed, 01 Jan 2020 23:27:02 GMT) Full text and rfc822 format available.

Message #38 received at 35284 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: auctex <at> gnu.org,
 Denis Bitouzé <denis.bitouze <at> univ-littoral.fr>,
 35284 <at> debbugs.gnu.org, jfbu <jfbu <at> free.fr>
Subject: Re: bug#35284: Empty line after an environment & bug#35284: 12.1.1;
 new verbatim environment wrongly commented out
Date: Thu, 02 Jan 2020 00:25:52 +0100
Hi Keita,

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

> Though I haven't heard from Jean yet, I committed the fix to the git
> repo with regression test.  Please let me know if it causes any bad
> side effect.

many thanks for fixing this issue.  Can you please also add an entry to
changes.texi?  This is a user visible change and we should mention it.

TIA.  Best, Arash




Added tag(s) fixed. Request was from Ikumi Keita <ikumi <at> ikumi.que.jp> to control <at> debbugs.gnu.org. (Tue, 07 Jan 2020 12:11:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 35284 <at> debbugs.gnu.org and jfbu <jfbu <at> free.fr> Request was from Ikumi Keita <ikumi <at> ikumi.que.jp> to control <at> debbugs.gnu.org. (Tue, 07 Jan 2020 12:11:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Feb 2020 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 198 days ago.

Previous Next


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