1

If we have a class like the one below emacs is indenting the : (to the initialization list). To be able to match some other editor, is it possible in emacs to indent the : like below?

class Test
{
public:
   Test(int a, int b)
   :
      m_a{a}, m_b{b}
   {
   }
private:
   int m_a, m_b;
};

currently the indentation is like this:

class Test
{
public:
   Test(int a, int b)
      :
      m_a{a}, m_b{b}
   {
   }
private:
   int m_a, m_b;
};
  • could you also give example for how the default configuration is indenting – junnu Oct 16 '18 at 8:49
  • 1
    I believe Emacs uses the same styles for indenting C and C++ (not 100% sure though). Look what styles are listed in c-style-alist variable, and try them by setting c-default-style. – wvxvw Oct 16 '18 at 12:52

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.