Go to the first, previous, next, last section, table of contents.

How do I indent switch statements like this?

Many people want to indent their switch statements like this:

  f()
  {
    switch(x) {
      case A:
        x1;
        break;
      case B:
        x2;
        break;
      default:
        x3;
    }
  }

I don't believe there is any way to do this exactly without modifying the Lisp code in c-mode.el. You can set c-indent-level to 4 and c-label-offset to -2, but this has bad effects elsewhere. {Anyone have a solution?}


Go to the first, previous, next, last section, table of contents.