This function simply looks to see if the brace closes a `do-while'
clause and if so, returns the list ``(before)'' indicating that a
newline should be inserted before the brace, but not after it. In all
other cases, it returns the list ``(before after)'' so that the brace
appears on a line by itself.
During the call to the brace hanging ACTION function, the variable
`c-syntactic-context' is bound to the full syntactic analysis list.
Note that for symmetry, colon hanginess should be customizable by
allowing function symbols as ACTIONs on the `c-hanging-colon-alist'
variable. Since no use has actually been found for this feature, it
isn't currently implemented.
File: ccmode, Node: Customizing Semi-colons and Commas, Next: Other Special Indentations, Prev: Custom Brace and Colon Hanging, Up: Advanced Customizations
Customizing Semi-colons and Commas
----------------------------------
You can also customize the insertion of newlines after semi-colons
and commas, when the auto-newline minor mode is enabled (see *Note
Minor Modes::). This is controlled by the variable
`c-hanging-semi&comma-criteria', which contains a list of functions
that are called in the order they appear. Each function is called with
zero arguments, and is expected to return one of the following values:
* non-`nil' - A newline is inserted, and no more functions from the
list are called.
* `stop' - No more functions from the list are called, but no
newline is inserted.
* `nil' - No determination is made, and the next function in the
list is called.
If every function in the list is called without a determination being
made, then no newline is added. The default value for this variable is a
list containing a single function which inserts newlines only after
semi-colons which do not appear inside parenthesis lists (i.e. those
that separate `for'-clause statements).
File: ccmode, Node: Other Special Indentations, Prev: Customizing Semi-colons and Commas, Up: Advanced Customizations
Other Special Indentations
--------------------------
One other customization variable is available in `cc-mode':
`c-special-indent-hook'. This is a standard hook variable that is
called after every line is indented by `cc-mode'. You can use it to do
any special indentation or line adjustments your style dictates, such
as adding extra indentation to constructors or destructor declarations
in a class definition, etc. Note however, that you should not change
point or mark inside your `c-special-indent-hook' functions (i.e.
you'll probably want to wrap your function in a `save-excursion').