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 17:34:21 +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;
>             });
> 
> 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.

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




reply via email to

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