CC MODE Version 5 Documentation. Node: Auto-newline insertion

prev UP Minor Modes NEXT Hungry-deletion of whitespace

4.1: Auto-newline insertion

Auto-newline minor mode works by enabling certain electric commands. Electric commands are typically bound to special characters such as the left and right braces, colons, semi-colons, etc., which when typed, perform some magic formatting in addition to inserting the typed character. As a general rule, electric commands are only electric when the following conditions apply:

  • Hanging Braces
  • Hanging Colons
  • Hanging Semi-colons and commas
  • Other electric commands
  • Clean-ups

  • [1] A literal is defined as any comment, string, or C preprocessor macro definition. These constructs are also known as syntactic whitespace since they are usually ignored when scanning C code.

    prev UP Minor Modes NEXT Hungry-deletion of whitespace