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

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

Re: cc-mode indent, exception for long lines


From: Benjamin Riefenstahl
Subject: Re: cc-mode indent, exception for long lines
Date: 18 Oct 2002 18:47:12 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Hi Matt,


Matt Armstrong <matt@lickey.com> writes:
> I like to keep my C code lines to 80 columns, for easier
> editing/printing.

Lots of people agree with that rule ;-). 

> But, sometimes I have a long string constant or identifier, and
> cc-mode's indentation isn't optimal.  E.g.
> 
>     if (ReallyLongFunctionName(AnotherReallyLongFunctionName("a really long 
> string constant") 
>     {
>     }

? There is no problem with indentation here, is there?  What you seem
to want is automatic insertion of line ends for wrapping.  cc-mode
doesn't do that, I admit.  I'm not sure I would want it either.

>     if (ReallyLongFunctionName(
>                 AnotherReallyLongFunctionName(
>                     "a really long string constant") 
>     {
>     }

With my settings and adding the missing parentheses to your code I get

        if (ReallyLongFunctionName(
                    AnotherReallyLongFunctionName(
                            "a really long string constant")))
        {
        }

Which is pretty near to what you seem to want.  I did have to add line
breaks manually, of course. 


so long, benny


reply via email to

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