This is a bug in the built-in function 'forward-comment' of later XEmacs
versions. I already reported this bug 10 months ago:
- Bug in `forward-comment' (only 21.4, 21.1 is ok):
Test case:
- load mode that has comment-start = "--" (ada-mode, vhdl-mode)
- (forward-comment '-1) after a line that starts with an odd
number of "-", e.g.
--- this is a legal comment
^ cursor will be positioned here
This bug is severe because it breaks indentation as well!
Reto
michael methfessel wrote:
Hi,
thank you for writing vhdl-mode, a very usefool tool. However, there
is one annoying feature which is presumably a bug. When I use three
hyphens to start a comment (this happens to be my personal convention)
the indentation is faulty in the following lines. Here is my vhdl file:
library IEEE;
use IEEE.Std_Logic_1164.all;
entity mips4kep is
port (cmd: in integer;
eb_avalid: out std_logic;
eb_write: out std_logic;
eb_a: out std_logic_vector (29 downto 0);
eb_rdata: in std_logic_vector (31 downto 0);
eb_wdata: out std_logic_vector (31 downto 0)
);
end;
-- fmi --
architecture fmi of mips4kep is
attribute Foreign of fmi:architecture is
"libfmi:mips4kep";
begin
end fmi;
In this form, indentation works. But if I write the comment as
--- fmi --
things go wrong starting with line "architecture fmi of mips4kep is".
To kreis this ein I switched on vhdl-echo-syntactic-information-p:
-- fmi --
syntax: ((comment) (statement . 47)), indent= -1000
architecture fmi of mips4kep is
syntax: ((statement . 47)), indent= 0
--- fmi --
syntax: ((comment) (statement . 47)), indent= -1000
architecture fmi of mips4kep is
syntax: ((statement-cont . 347)), indent= 4
So, "architecture.." is indented by 4 if the comment starts with
"---".
I tried looking into the lisp, but I don't think I would be able
to find the reason myself.
Thanks for any help, Michael