ccmode: Line-Up Functions

 
 11.3 Line-Up Functions
 ======================
 
 Often there are cases when a simple offset setting on a syntactic symbol
 isn’t enough to get the desired indentation—for example, you might want
 to line up a closing parenthesis with the matching opening one rather
 than indenting relative to its “anchor point”.  CC Mode provides this
 flexibility with “line-up functions”.
 
    The way you associate a line-up function with a syntactic symbol is
 described in Seec-offsets-alist.  CC Mode comes with many
 predefined line-up functions for common situations.  If none of these
 does what you want, you can write your own.  SeeCustom Line-Up.
 Sometimes, it is easier to tweak the standard indentation by adding a
 function to ‘c-special-indent-hook’ (SeeOther Indentation).
 
    The line-up functions haven’t been adapted for AWK buffers or tested
 with them.  Some of them might work serendipitously.  There shouldn’t be
 any problems writing custom line-up functions for AWK mode.
 
    The calling convention for line-up functions is described fully in
 SeeCustom Line-Up.  Roughly speaking, the return value is either an
 offset itself (such as ‘+’ or ‘[0]’) or it’s ‘nil’, meaning “this
 function is inappropriate in this case; try a different one”.  See
 c-offsets-alist.
 
    The subsections below describe all the standard line-up functions,
 categorized by the sort of token the lining-up centers around.  For each
 of these functions there is a “works with” list that indicates which
 syntactic symbols the function is intended to be used with.
 

Menu