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: Sam Steingold
Subject: Re: CC Mode 5.29 (); a recent incompatible identation change
Date: 26 May 2002 13:14:46 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> * In message <address@hidden>
> * On the subject of "Re: CC Mode 5.29 (); a recent incompatible identation 
> change"
> * Sent on 26 May 2002 17:34:21 +0200
> * Honorable Martin Stjernholm <address@hidden> writes:
>
> Sam Steingold <address@hidden> wrote:
> 
> > The identation of the following form has changed from
> > 
> >         foo(bar,baz, {
> >           zot;
> >         });
> > 
> > to
> > 
> >         foo(bar,baz, {
> >               zot;
> >             });
> > 
> > recently in the CVS emacs.
> > was it an intentional change?
> 
> Yes. It is to achieve better consistency with cases like this:
> 
>     foo(bar,baz,
>       {
>           zot;
>       });
>     foo(bar, {
>           zot;
>       },
>       baz);
> 
> where the latter previously was indented as:
> 
>     foo(bar, {
>       zot;
>     },
>       baz);
> 
> which imo looks odd, especially if "foo" is a long identifier or
> expression.

the new method gives _much_ larger indentation resulting in less
readable code, expecially when "foo" is _really_ long.

> > how to I revert it in my .emacs.el?
> 
> With something like this:
> 
>     (defun indent-to-boi (langelem)
>       (save-excursion
>         (goto-char (cdr langelem))
>         (back-to-indentation)
>         (vector (current-column))))
> 
>     (defun indent-to-boi+offset (langelem)
>       (save-excursion
>         (goto-char (cdr langelem))
>         (back-to-indentation)
>         (vector (+ (current-column) c-basic-offset))))
> 
>     (c-set-offset 'block-close 'indent-to-boi)
>     (c-set-offset 'statement-block-intro 'indent-to-boi+offset)

thanks.
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).

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.2 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Trespassers will be shot.  Survivors will be prosecuted.



reply via email to

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