emacs-devel
[Top][All Lists]
Advanced

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

Re: CC Mode 5.29 (); a recent incompatible identation change


From: Martin Stjernholm
Subject: Re: CC Mode 5.29 (); a recent incompatible identation change
Date: 26 May 2002 19:40:32 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Sam Steingold <address@hidden> wrote:

> > > The identation of the following form has changed from
> > > 
> > >         foo(bar,baz, {
> > >           zot;
> > >         });
> > > 
> > > to
> > > 
> > >         foo(bar,baz, {
> > >               zot;
> > >             });
/.../
> the new method gives _much_ larger indentation resulting in less
> readable code, expecially when "foo" is _really_ long.

That is a general problem in the indentation of function arguments,
not just when they have nested code blocks. I deal with it by
inserting a line break after the open parenthesis, treating it much
like a brace block opener:

    some_really_long_function_identifier (
        bar, {
            zot;
        },
        baz);

> it would be nice if there were a customization option, e.g.
> `cc-mode-indent-statement-block', with-values 'boi (old) and
> 'statement+boi (new).

The problem really lies in the indentation of arglist-cont-nonempty,
which is usually set to c-lineup-arglist. It ought to be possible to
get approximately the identation you want in a consistent manner by
setting arglist-cont-nonempty to + instead. Currently it isn't, since
statement-block-intro and block-close aren't stacked with
arglist-cont-nonempty. I'll fix that.




reply via email to

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