1

Using GNU Emacs 24.5.1

My c++-mode hook has (c-set-style "cc-mode"). This works fairly well for me, with the following exceptions:

First of all: try-blocks are indented

int main()
   try 
      {
        //...
      }
   catch (...)
      {
        // ...
      }

I would prefer

int main()
try 
{
        //...
}
catch (...)
{
        // ...
}

In addition, when using enum class, I get

enum class Month {
  jan=1, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec
    };

It would be more natural for the closing brace to be flush left:

enum class Month {
  jan=1, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec
};

I have also tried all the other built-in styles. The two that work best are cc-mode and stroustrup, but neither give me the behavior I would like.

Suggestions? Many thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.