unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22368: vhdl comment-uncomment problem, apparently (or not) related to 14335 and 5997
@ 2016-01-14  0:12 John Chapple
  2016-01-14 17:10 ` bug#22368: Another way to produce the same result John Chapple
  0 siblings, 1 reply; 7+ messages in thread
From: John Chapple @ 2016-01-14  0:12 UTC (permalink / raw)
  To: 22368

[-- Attachment #1: Type: text/plain, Size: 2755 bytes --]

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
 		 	   		  

[-- Attachment #2: Type: text/html, Size: 3712 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22368: Another way to produce the same result
  2016-01-14  0:12 bug#22368: vhdl comment-uncomment problem, apparently (or not) related to 14335 and 5997 John Chapple
@ 2016-01-14 17:10 ` John Chapple
  2020-08-15  5:34   ` Stefan Kangas
  0 siblings, 1 reply; 7+ messages in thread
From: John Chapple @ 2016-01-14 17:10 UTC (permalink / raw)
  To: 22368@debbugs.gnu.org


[-- Attachment #1.1: Type: text/plain, Size: 433 bytes --]

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
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 688 bytes --]

[-- Attachment #2: bug.vhdl --]
[-- Type: application/octet-stream, Size: 1102 bytes --]

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

--library work;
--use		work.definitions.all;

--entity ccf_operation is
--port(
--	flags_in:	in	std_logic_vector(7 downto 0);
--	flags_out:	out	std_logic_vector(7 downto 0)
--);
--end;

---- Tested with Modelsim 2015/11/25, works.

--architecture struct_ccf_operation of ccf_operation is
--begin
--	-- A point of disagreement has been found between the Z80 user manual
--	-- and Lance Levinthal's book entitled "Z80 Assembly Language Programming".
--	-- The Z80 user manual says the half-carry bit gets the previous carry;
--	-- Levinthal says the half-carry bit is unchanged.  For now, go with
--	-- Levinthal's version as the Z80 users manual is inconsistent with
--	-- itself on other instructions.  At this time, no such inconsistencies
--	-- have been found with Levinthal's work.

--	flags_out <= (	carry_bit => not flags_in(carry_bit),
----					half_carry_bit <= flags_in(carry_bit),
--					others => '0');
--end;

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

--library work;
--use		work.definitions.all;


^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22368: Another way to produce the same result
  2016-01-14 17:10 ` bug#22368: Another way to produce the same result John Chapple
@ 2020-08-15  5:34   ` Stefan Kangas
  2020-08-18 10:43     ` Reto Zimmermann
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Kangas @ 2020-08-15  5:34 UTC (permalink / raw)
  To: John Chapple; +Cc: Reto Zimmermann, 22368@debbugs.gnu.org

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@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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22368: Another way to produce the same result
  2020-08-15  5:34   ` Stefan Kangas
@ 2020-08-18 10:43     ` Reto Zimmermann
  2020-08-18 11:39       ` Stefan Kangas
  0 siblings, 1 reply; 7+ messages in thread
From: Reto Zimmermann @ 2020-08-18 10:43 UTC (permalink / raw)
  To: Stefan Kangas, John Chapple; +Cc: Reto Zimmermann, 22368@debbugs.gnu.org

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@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






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22368: Another way to produce the same result
  2020-08-18 10:43     ` Reto Zimmermann
@ 2020-08-18 11:39       ` Stefan Kangas
  2020-08-19 11:52         ` Reto Zimmermann
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Kangas @ 2020-08-18 11:39 UTC (permalink / raw)
  To: Reto Zimmermann, John Chapple; +Cc: 22368@debbugs.gnu.org

Hi,

Reto Zimmermann <reto@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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22368: Another way to produce the same result
  2020-08-18 11:39       ` Stefan Kangas
@ 2020-08-19 11:52         ` Reto Zimmermann
  2021-12-02  8:48           ` bug#22368: vhdl comment-uncomment problem, apparently (or not) related to 14335 and 5997 Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Reto Zimmermann @ 2020-08-19 11:52 UTC (permalink / raw)
  To: Stefan Kangas, John Chapple; +Cc: 22368@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]

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@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


[-- Attachment #2: Type: text/html, Size: 2276 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22368: vhdl comment-uncomment problem, apparently (or not) related to 14335 and 5997
  2020-08-19 11:52         ` Reto Zimmermann
@ 2021-12-02  8:48           ` Lars Ingebrigtsen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2021-12-02  8:48 UTC (permalink / raw)
  To: Reto Zimmermann; +Cc: John Chapple, Stefan Kangas, 22368@debbugs.gnu.org

Reto Zimmermann <reto@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





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-02  8:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-14  0:12 bug#22368: vhdl comment-uncomment problem, apparently (or not) related to 14335 and 5997 John Chapple
2016-01-14 17:10 ` bug#22368: Another way to produce the same result John Chapple
2020-08-15  5:34   ` Stefan Kangas
2020-08-18 10:43     ` Reto Zimmermann
2020-08-18 11:39       ` Stefan Kangas
2020-08-19 11:52         ` Reto Zimmermann
2021-12-02  8:48           ` bug#22368: vhdl comment-uncomment problem, apparently (or not) related to 14335 and 5997 Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).