Next: Electric Keys, Previous: Filling and Breaking, Up: Commands
CC Mode contains several minor-mode-like features that you might find useful while writing new code or editing old code:
forward-word) and M-b (backward-word) treat the
parts of sillycapsed symbols as different words.
E.g. `NSGraphicsContext' is treated as three words `NS',
`Graphics', and `Context'.
Full details on how these minor modes work are at Electric Keys, Auto-newlines, Hungry WS Deletion, Subword Movement, and Indentation Engine Basics.
You can toggle each of these minor modes on and off, and you can configure CC Mode so that it starts up with your favourite combination of them (see Sample .emacs File). By default, when you initialize a buffer, electric mode and syntactic-indentation mode are enabled but the other two modes are disabled.
CC Mode displays the current state of the first four of these minor modes on the modeline by appending letters to the major mode's name, one letter for each enabled minor mode - `l' for electric mode, `a' for auto-newline mode, `h' for hungry delete mode, and `w' for subword mode. If all these modes were enabled, you'd see `C/lahw'1.
Here are the commands to toggle these modes:
c-toggle-electric-state)c-toggle-auto-newline)M-x c-subword-mode)Common to all the toggle functions above is that if they are called
programmatically, they take an optional numerical argument. A
positive value will turn on the minor mode (or both of them in the
case of c-toggle-auto-hungry-state) and a negative value will
turn it (or them) off.