Re: C comments change from emacs 20

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: C comments change from emacs 20

Alan Mackenzie
kgold <[hidden email]> wrote on 31 May 2005 17:40:30 GMT:
> Alan Mackenzie <[hidden email]> writes:
>> kgold <[hidden email]> wrote on 20 May 2005 13:19:27 GMT:
>> > In C mode, the continuation line for comments after a blank line
>> > doesn't indent in 21.3.  It did in 20.7.  How can I get the 20.7,
>> > IMHO correct, behavior.

>> > /* In emacs 21.3

>> > Here's where the next line starts, not indented
>> > */

>> > /* In emacs 20.7

>> >    It starts here, indented
>> > */

>> Well, when I start Emacs 21.3 without my .emacs, I get the the result
>> you want, not the one you get.  If you start with  emacs -q
>> --no-site-file, what happens then?  If that works OK, chances are
>> you've got some setting in your .emacs (or site-start.el) which is
>> upsetting the comment indentation.

>> If this is the case, try doing C-c C-b (`c-submit-bug-report') to get
>> about 91 lines dump of CC Mode's internal configuration.  If that doesn't
>> help you get sorted out, post the dump here.

> Thanks for the reply.  It fails for me with -q --no-site-file on both
> Linux and AIX emacs 21.3.  

> Did you notice the blank 2nd line?  That is:

> /* Without a blank line
>    the next line indents
> */

No, I didn't notice it.  Sorry.  And now that I have noticed it, I get
the same effect as you do.

Emacs 20.7 had CC Mode 5.25 (I think), and Emacs 21.3 has CC Mode 5.28.
Adaptive filling was introduced into CC Mode in version 5.26.  This might
have something to do with the problem.

> /* With a blank next line
> this line doesn't indent.
> */

The indentation of C-style comment continuation lines (ones with /* ...
*/) is usually done by the function c-lineup-C-comments, and at a guess,
it is indenting a line to the same degree as the previous line, rather
than the previous none-blank line.

I'll take a closer look at this function sometime soon.  I think it could
well be a sub-optimal feature in CC Mode which could do with improvement.
I don't see any quick way of fixing it right now.

You might want to submit this as a request to the CC Mode mailing list on
<[hidden email]>.  So might I!

Sorry I can't offer anything better.

> Ken Goldman   [hidden email]   914-784-7646

Alan Mackenzie (Munich, Germany)
Email: [hidden email]; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

Help-gnu-emacs mailing list
[hidden email]