emacs-devel
[Top][All Lists]
Advanced

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

c-mode: inconsistent enum/struct brace indentation?


From: Jim Meyering
Subject: c-mode: inconsistent enum/struct brace indentation?
Date: Wed, 25 Apr 2012 08:44:58 +0200

I've just run emacs -q empty.c and then typed in
the following, letting the default indentation take effect:

enum foo
  {
  };

struct b
{
};

Shouldn't their opening braces be placed consistently, by default?
I expected this:

enum foo
{
};

struct b
{
};

In the GCS, I see that a struct's opening brace may
indeed be placed in column 1, but it says nothing of 'enum's.

GNU indent does place the enum's "{" in column 1:

    $ printf 'enum foo {\nx }; struct b { int i; };\n'|indent -npro
    enum foo
    {
      x
    };
    struct b
    {
      int i;
    };

Note that I inserted the \n-before-"x" solely to avoid the
following indent quirk, but even in that case, the opening brace
was still in column 1:

    enum foo
    { x };
    ...



reply via email to

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