GNU bug report logs - #22368
vhdl comment-uncomment problem, apparently (or not) related to 14335 and 5997

Previous Next

Package: emacs;

Reported by: John Chapple <jrchapple <at> sympatico.ca>

Date: Thu, 14 Jan 2016 00:59:01 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 22368 in the body.
You can then email your comments to 22368 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-gnu-emacs <at> gnu.org:
bug#22368; Package emacs. (Thu, 14 Jan 2016 00:59:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to John Chapple <jrchapple <at> sympatico.ca>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 14 Jan 2016 00:59:01 GMT) Full text and rfc822 format available.

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

From: John Chapple <jrchapple <at> sympatico.ca>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: vhdl comment-uncomment problem, apparently (or not) related to
 14335 and 5997
Date: Thu, 14 Jan 2016 00:12:47 +0000
[Message part 1 (text/plain, inline)]
Hello Ladies and/or Gentlemen:

OS: Ubuntu 14.04 LTS
Emacs version: GNU emacs 24.3.1 (x86-64-pc-linux-gnu, GTK+ Version 3.10.7 of 2014-03-07 on lamiak, modified by Debian

Modifications by Debian are unknown to this user.  I do not know how to install software manually.  No add-ons were installed.

The software was installed from Ubuntu repository, unmodified, by Ubuntu's software installer.  I have not attempted any modifications.

In xterm, this emacs invocation produced an error message on the EMACS status line

emacs -0 failed

Related bugs: 14335, 5997, statements the numbered bugs have been addressed in Emacs 24.3

Now to the problem:

Original file:

-- this is a test comment

library ieee;
use        ieee.std_logic_1164.all

entity and8 is
port(
    in1, in2:    in    std_logic_vector(7 downto 0);
    y:            out    std_logic_vector(7 downto 0)
);
end;

-- this is another test comment

architecture struct_and8 of and8 is
begin
    y <= in1 and in2;
end;

End of original file.

Mark block of code with mouse, under VHDL drop down menu, select Comment, select (Un)Comment Out Region, this is the result:

-- *********beginning of commented code**********

---- this is a test comment

--library ieee;
--use        ieee.std_logic_1164.all

--entity and8 is
--port(
--    in1, in2:    in    std_logic_vector(7 downto 0);
--    y:            out    std_logic_vector(7 downto 0)
--);
--end;

---- this is another test comment

--architecture struct_and8 of and8 is
--begin
--    y <= in1 and in2;
--end;

---- *******end of commented code***********

The code is commented properly.

Mark block of code with mouse, under VHDL drop down menu, select Comment, select (Un)Comment Out Region, this is the result:

-- *******beginning of code that is commented and immediately uncommented***********

 this is a test comment

library ieee;
use        ieee.std_logic_1164.all

entity and8 is
port(
    in1, in2:    in    std_logic_vector(7 downto 0);
    y:            out    std_logic_vector(7 downto 0)
);
end;

 this is another test comment

architecture struct_and8 of and8 is
begin
    y <= in1 and in2;
end;

Emacs removed *all* comment markers.  I think this is overzealous.  The comment markers for the comment test lines should have been put back the way they were in the original file, that is, with one comment marker.

I think I am safe in saying all compliant VHDL compilers (any VHDL version) emit error message(s) on or about the lines containing the word 'test'.

If this variant to bugs 14335 and 5997 has been dealt with, please accept my apologies.  I didn't see it mentioned in the bug reports.

Cheers
John
 		 	   		  
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22368; Package emacs. (Thu, 14 Jan 2016 17:11:01 GMT) Full text and rfc822 format available.

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

From: John Chapple <jrchapple <at> sympatico.ca>
To: "22368 <at> debbugs.gnu.org" <22368 <at> debbugs.gnu.org>
Subject: Another way to produce the same result
Date: Thu, 14 Jan 2016 17:10:44 +0000
[Message part 1 (text/plain, inline)]
Hello again, Ladies and/or Gentlemen,

I have found another method to reproduce this problem that perhaps is clearer:

Open the attached file.

Using the mouse, select Edit | Select All .

Using the mouse, select VHDL | Comment | (Un)Comment Out Region.

Line 14 will now be rejected by any VHDL compiler.  The file is saved to disk as it appears on the screen.  I checked with another editor.

Cheers
John
 		 	   		  
[Message part 2 (text/html, inline)]
[bug.vhdl (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22368; Package emacs. (Sat, 15 Aug 2020 05:35:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: John Chapple <jrchapple <at> sympatico.ca>
Cc: Reto Zimmermann <reto <at> gnu.org>,
 "22368 <at> debbugs.gnu.org" <22368 <at> debbugs.gnu.org>
Subject: Re: bug#22368: Another way to produce the same result
Date: Fri, 14 Aug 2020 22:34:40 -0700
Hi Reto,

Could you please help take a look at the below bug report in vhdl-mode?
It was reported over 4 years ago but unfortunately never got a reply at
the time.

Thanks in advance.

Best regards,
Stefan Kangas

John Chapple <jrchapple <at> sympatico.ca> writes:

> Hello again, Ladies and/or Gentlemen,
>
> I have found another method to reproduce this problem that perhaps is clearer:
>
> Open the attached file.
>
> Using the mouse, select Edit | Select All .
>
> Using the mouse, select VHDL | Comment | (Un)Comment Out Region.
>
> Line 14 will now be rejected by any VHDL compiler.  The file is saved to disk as it appears on the screen.  I checked with another editor.
>
> Cheers
> John




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22368; Package emacs. (Tue, 18 Aug 2020 11:40:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Reto Zimmermann <reto <at> gnu.org>, John Chapple <jrchapple <at> sympatico.ca>
Cc: "22368 <at> debbugs.gnu.org" <22368 <at> debbugs.gnu.org>
Subject: Re: bug#22368: Another way to produce the same result
Date: Tue, 18 Aug 2020 11:39:38 +0000
Hi,

Reto Zimmermann <reto <at> gnu.org> writes:

> The file is missing.  Could you please re-attach?

Sorry, it was missing in my reply.

You can find the file here:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22368#8

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22368; Package emacs. (Tue, 18 Aug 2020 12:20:02 GMT) Full text and rfc822 format available.

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

From: Reto Zimmermann <reto <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>, John Chapple <jrchapple <at> sympatico.ca>
Cc: Reto Zimmermann <reto <at> gnu.org>,
 "22368 <at> debbugs.gnu.org" <22368 <at> debbugs.gnu.org>
Subject: Re: bug#22368: Another way to produce the same result
Date: Tue, 18 Aug 2020 12:43:00 +0200
Hi Stefan, John,

The file is missing.  Could you please re-attach?

Reto


On 2020-08-15 07:34, Stefan Kangas wrote:
> Hi Reto,
>
> Could you please help take a look at the below bug report in vhdl-mode?
> It was reported over 4 years ago but unfortunately never got a reply at
> the time.
>
> Thanks in advance.
>
> Best regards,
> Stefan Kangas
>
> John Chapple <jrchapple <at> sympatico.ca> writes:
>
>> Hello again, Ladies and/or Gentlemen,
>>
>> I have found another method to reproduce this problem that perhaps is clearer:
>>
>> Open the attached file.
>>
>> Using the mouse, select Edit | Select All .
>>
>> Using the mouse, select VHDL | Comment | (Un)Comment Out Region.
>>
>> Line 14 will now be rejected by any VHDL compiler.  The file is saved to disk as it appears on the screen.  I checked with another editor.
>>
>> Cheers
>> John





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22368; Package emacs. (Wed, 19 Aug 2020 11:53:02 GMT) Full text and rfc822 format available.

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

From: Reto Zimmermann <reto <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>, John Chapple <jrchapple <at> sympatico.ca>
Cc: "22368 <at> debbugs.gnu.org" <22368 <at> debbugs.gnu.org>
Subject: Re: bug#22368: Another way to produce the same result
Date: Wed, 19 Aug 2020 13:52:22 +0200
[Message part 1 (text/plain, inline)]
Thanks,

vhdl-mode is using function 'comment-region' from the ‘newcomment.el’ 
package. With the default value of 1 for option 'comment-padding' the 
comment string "-- " is inserted, resulting in

-- -- this is a test comment

-- library ieee;
-- use        ieee.std_logic_1164.all

for which uncommenting works fine.  You might have changed 
'comment-padding' to 0, which is when you get

---- this is a test comment

--library ieee;
--use        ieee.std_logic_1164.all

For this, 'comment-region' doesn't work correctly for languages with 
comment starts that contain 2 of the same characters, like "--" in VHDL 
or "//" in C++. C++-mode doesn't honor the 'comment-padding' option 
though and always inserts "// ", so the problem doesn't occur.

Remedies:

1. Use 1 for 'comment-padding'
2. File a bug report against 'newcomment.el'
3. Make vhdl-mode not honor option 'comment-padding'

Regards,
Reto


On 2020-08-18 13:39, Stefan Kangas wrote:
> Hi,
>
> Reto Zimmermann <reto <at> gnu.org> writes:
>
>> The file is missing.  Could you please re-attach?
> Sorry, it was missing in my reply.
>
> You can find the file here:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22368#8
>
> Best regards,
> Stefan Kangas

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22368; Package emacs. (Thu, 02 Dec 2021 08:49:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Reto Zimmermann <reto <at> gnu.org>
Cc: John Chapple <jrchapple <at> sympatico.ca>, Stefan Kangas <stefan <at> marxist.se>,
 "22368 <at> debbugs.gnu.org" <22368 <at> debbugs.gnu.org>
Subject: Re: bug#22368: vhdl comment-uncomment problem, apparently (or not)
 related to 14335 and 5997
Date: Thu, 02 Dec 2021 09:48:36 +0100
Reto Zimmermann <reto <at> gnu.org> writes:

> Remedies:
>
> 1 Use 1 for 'comment-padding'

If I understand correctly, the default value of `comment-padding' (i.e.,
" ") works fine, so I think 1) sounds like the correct solution, and
there doesn't seem to be anything to do in vhdl-mode here, at least.

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 22368 <at> debbugs.gnu.org and John Chapple <jrchapple <at> sympatico.ca> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 02 Dec 2021 08:49: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. (Thu, 30 Dec 2021 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 79 days ago.

Previous Next


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