diff options
Diffstat (limited to 'doc/misc/cc-mode.texi')
-rw-r--r-- | doc/misc/cc-mode.texi | 125 |
1 files changed, 122 insertions, 3 deletions
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 0c77cc0ee61..170149eb550 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -5638,9 +5638,9 @@ any problems writing custom line-up functions for AWK mode. The calling convention for line-up functions is described fully in @ref{Custom Line-Up}. Roughly speaking, the return value is either an -offset itself (such as @code{+} or @code{[0]}) or it's @code{nil}, -meaning ``this function is inappropriate in this case; try a -different one''. @xref{c-offsets-alist}. +offset itself (such as @code{+} or @code{[0]}), another line-up +function, or it's @code{nil}, meaning ``this function is inappropriate +in this case - try a different one''. @xref{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 @@ -5995,6 +5995,125 @@ brace block. @comment ------------------------------------------------------------ +@defun c-lineup-2nd-brace-entry-in-arglist +@findex lineup-2nd-brace-entry-in-arglist (c-) +Line up the second entry of a brace block under the first, when the +first line is also contained in an arglist or an enclosing brace +@emph{on that line}. + +I.e. handle something like the following: + +@example +@group +set_line (line_t @{point_t@{0.4, 0.2@}, + point_t@{0.2, 0.5@}, @hereFn{brace-list-intro} + .....@}); + ^ enclosing parenthesis. +@end group +@end example + + +The middle line of that example will have a syntactic context with +three syntactic symbols, @code{arglist-cont-nonempty}, +@code{brace-list-intro}, and @code{brace-list-entry} (@pxref{Brace +List Symbols}). + +This function is intended for use in a list. If the construct being +analyzed isn't like the preceding, the function returns nil. +Otherwise it returns the function +@code{c-lineup-arglist-intro-after-paren}, which the caller then uses +to perform indentation. + +@workswith{} @code{brace-list-intro}. +@end defun + +@comment ------------------------------------------------------------ + +@defun c-lineup-class-decl-init-+ +@findex lineup-class-decl-init-+ (c-) +Line up the second entry of a class (etc.) initializer +@code{c-basic-offset} characters in from the identifier when: +@enumerate +@item +The type is a class, struct, union, etc. (but not an enum); +@item +There is a brace block in the type declaration, specifying it; and +@item +The first element of the initializer is on the same line as its +opening brace. +@end enumerate + +I.e. we have a construct like this: + +@example +@group +struct STR @{ + int i; float f; +@} str_1 = @{1, 1.7@}, + str_2 = @{2, + 3.1 @hereFn{brace-list-intro} + @}; + @sssTBasicOffset{} +@end group +@end example + + +Note that the syntactic context of the @code{brace-list-intro} line +also has a syntactic element with the symbol @code{brace-list-entry} +(@pxref{Brace List Symbols}). + +This function is intended for use in a list. If the above structure +isn't present, the function returns nil, allowing a different offset +specification to indent the line. + +@workswith{} @code{brace-list-intro}. +@end defun + +@comment ------------------------------------------------------------ + +@defun c-lineup-class-decl-init-after-brace +@findex lineup-class-decl-init-after-brace (c-) +Line up the second entry of a class (etc.) initializer after its +opening brace when: +@enumerate +@item +The type is a class, struct, union, etc. (but not an enum); +@item +There is a brace block in the type declaration, specifying it; and +@item +The first element of the initializer is on the same line as its +opening brace. +@end enumerate + +I.e. we have a construct like this: + +@example +@group +struct STR @{ + int i; float f; +@} str_1 = @{1, 1.7@}, + str_2 = @{2, + 3.1 @hereFn{brace-list-intro} + @}; +@end group +@end example + + +Note that the syntactic context of the @code{brace-list-intro} line +also has a syntactic element with the symbol @code{brace-list-entry} +(@pxref{Brace List Symbols}). Also note that this function works by +returning the symbol @code{c-lineup-arglist-intro-after-paren}, which +the caller then uses to perform the indentation. + +This function is intended for use in a list. If the above structure +isn't present, the function returns nil, allowing a different offset +specification to indent the line. + +@workswith{} @code{brace-list-intro}. +@end defun + +@comment ------------------------------------------------------------ + @defun c-lineup-multi-inher @findex lineup-multi-inher @r{(c-)} Line up the classes in C++ multiple inheritance clauses and member |