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

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

C++ Classes, Access Identifiers indentation


From: David Gomes
Subject: C++ Classes, Access Identifiers indentation
Date: Sun, 21 Oct 2012 15:36:59 +0100

Hello,

class MyClass {
public:
  int a = 5;

private:
}

On c++-mode, I was getting that kind of indentation on a class on a .hpp file. I went to #emacs to look for help and a very kind man offered a couple of solutions:

(c-set-offset 'access-label '+) ;This results in:

class Yerkusk {
    public:
  int a = 5;

    private:
}

(c-set-offset 'access-label '/) ; This results in:

class Yerkusk {
 public:
  int a = 5;

 private:
}

My c-basic-offset is 2 and ideally I want it to look like this:

class Yerkusk {
  public:
    int a = 5;

   private:
}

Any ideas? Thank you in advance.

reply via email to

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