Next: Operator Line-Up, Previous: Brace/Paren Line-Up, Up: Line-Up Functions [Contents][Index]
The line-up functions here calculate the indentation for lines which form lists of items, usually separated by commas.
The function c-lineup-arglist-close-under-paren, which is mainly for indenting a close parenthesis, is also useful for the lines contained within parentheses.
Line up the current argument line under the first argument.
As a special case, if an argument on the same line as the open
parenthesis starts with a brace block opener, the indentation is
c-basic-offset only. This is intended as a “DWIM” measure in
cases like macros that contain statement blocks, e.g.:
A_VERY_LONG_MACRO_NAME ({
some (code, with + long, lines * in[it]);
});
<--> c-basic-offsetThis is motivated partly because it’s more in line with how code blocks are handled, and partly since it approximates the behavior of earlier CC Mode versions, which due to inaccurate analysis tended to indent such cases this way.
Works with: arglist-cont-nonempty, arglist-close.
Line up a line to just after the open paren of the surrounding paren or brace block.
Works with: defun-block-intro, brace-list-intro,
statement-block-intro, statement-case-intro,
arglist-intro.
Line up the classes in C++ multiple inheritance clauses and member initializers under each other. E.g.:
Foo::Foo (int a, int b):
Cyphr (a),
Bar (b) <- c-lineup-multi-inherand
class Foo
: public Cyphr,
public Bar <- c-lineup-multi-inherand
Foo::Foo (int a, int b)
: Cyphr (a)
, Bar (b) <- c-lineup-multi-inherWorks with: inher-cont, member-init-cont.
Line up Java implements and extends declarations. If class names
follow on the same line as the ‘implements’/‘extends’
keyword, they are lined up under each other. Otherwise, they are
indented by adding c-basic-offset to the column of the keyword.
E.g.:
class Foo
extends
Bar <- c-lineup-java-inher <--> c-basic-offsetand
class Foo
extends Cyphr,
Bar <- c-lineup-java-inherWorks with: inher-cont.
Line up Java throws declarations. If exception names follow on the
same line as the throws keyword, they are lined up under each other.
Otherwise, they are indented by adding c-basic-offset to the
column of the ‘throws’ keyword. The ‘throws’ keyword itself
is also indented by c-basic-offset from the function declaration
start if it doesn’t hang. E.g.:
int foo()
throws <- c-lineup-java-throws Bar <- c-lineup-java-throws<--><--> c-basic-offsetand
int foo() throws Cyphr,
Bar, <- c-lineup-java-throws Vlod <- c-lineup-java-throwsWorks with: func-decl-cont.
Line up the arguments of a template argument list under each other, but only in the case where the first argument is on the same line as the opening ‘<’.
To allow this function to be used in a list expression, nil is
returned if there’s no template argument on the first line.
Works with: template-args-cont.
For Objective-C code, line up selector args as Emacs Lisp mode does with function args: go to the position right after the message receiver, and if you are at the end of the line, indent the current line c-basic-offset columns from the opening bracket; otherwise you are looking at the first character of the first method call argument, so lineup the current line with it.
Works with: objc-method-call-cont.
For Objective-C code, line up the colons that separate args. The colon on the current line is aligned with the one on the first line.
Works with: objc-method-args-cont.
Similar to c-lineup-ObjC-method-args but lines up the colon on
the current line with the colon on the previous line.
Works with: objc-method-args-cont.
Next: Operator Line-Up, Previous: Brace/Paren Line-Up, Up: Line-Up Functions [Contents][Index]