bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CC Mode 5.28 (C++); comment-indent-newline does not insert a comm en


From: Martin Stjernholm
Subject: Re: CC Mode 5.28 (C++); comment-indent-newline does not insert a comm ent delimiter after the new line.
Date: 13 Oct 2001 14:30:26 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

"Van Valen,Joseph - LGA" <vanvalen@att.com> wrote:

> int main()
> {
>       // This is line one of a comment
> 
> 
> 
> with the point at the end of the word "comment" execute "M-j" or"M-x
> comment-indent-newline". Note that the a 
> new line is created but the point is aligned with the first of the two
> slashes of the previous line instead of 
> inserting a new comment delimiter and aligning the point with the T of the
> word "This" in the previous line as 
> expected.

I regard this to be a bug in comment-indent-new-line in newcomment.el.
If comment-multi-line is t, it doesn't correctly insert the comment
start for line-based //-style comments.

I think that variable should only affect comments that actually can
continue over multiple lines, otherwise it should have no effect. This
behavior is useful to control the behavior in /* */-style comments
even though the "main" comment style is //.

[The rest is mostly directed to Stefan Monnier, the maintainer of
newcomment.el.]

Speaking of M-j, CC Mode currently overrides indent-new-comment-line
with its own c-indent-new-comment-line in a fairly ugly way by using
substitute-key-definition. This doesn't work in Emacs 21, due to the
function name change. I can of course fix that by replacing the new
comment-indent-new-line in the same way, but I think it'd be better to
improve the integration possibilities to avoid such measures.

I'd like a function hook much like comment-line-break-function, which
is currently used by auto-fill. Actually, in my case it'd work well to
simply use that variable also in comment-indent-new-line.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]