Variable: c-style-alist
c-style-alist is a variable defined in cc-styles.el.gz.
Value
Large value
(("csharp" "java" (c-basic-offset . 4)
(c-comment-only-line-offset 0 . 0)
(c-offsets-alist (inline-open . 0) (arglist-intro . +)
(arglist-close . 0) (inexpr-class . 0)
(case-label . +) (cpp-macro . c-lineup-dont-change)
(substatement-open . 0)))
("cc-mode" "user") ("user" (c-special-indent-hook))
("gnu" (c-basic-offset . 2) (c-comment-only-line-offset 0 . 0)
(c-hanging-braces-alist (substatement-open before after)
(arglist-cont-nonempty))
(c-offsets-alist (statement-block-intro . +) (knr-argdecl-intro . 5)
(substatement-open . +) (substatement-label . 0)
(label . 0) (statement-case-open . +)
(statement-cont . +)
(arglist-intro . c-lineup-arglist-intro-after-paren)
(arglist-close . c-lineup-arglist-close-under-paren)
(inline-open . 0) (brace-list-open . +)
(brace-list-intro first
c-lineup-2nd-brace-entry-in-arglist
c-lineup-class-decl-init-+ +)
(topmost-intro-cont first
c-lineup-topmost-intro-cont
c-lineup-gnu-DEFUN-intro-cont))
(c-special-indent-hook . c-gnu-impose-minimum)
(c-block-comment-prefix . ""))
("k&r" (c-basic-offset . 5) (c-comment-only-line-offset . 0)
(c-offsets-alist (statement-block-intro . +) (knr-argdecl-intro . 0)
(substatement-open . 0) (substatement-label . 0)
(label . 0) (statement-cont . +)))
("bsd" (c-basic-offset . 8) (c-comment-only-line-offset . 0)
(c-offsets-alist (statement-block-intro . +) (knr-argdecl-intro . +)
(substatement-open . 0) (substatement-label . 0)
(label . 0) (statement-cont . +) (inline-open . 0)
(brace-list-intro first
c-lineup-2nd-brace-entry-in-arglist
c-lineup-class-decl-init-+ +)
(inexpr-class . 0)))
("stroustrup" (c-basic-offset . 4) (c-comment-only-line-offset . 0)
(c-offsets-alist (statement-block-intro . +) (substatement-open . 0)
(substatement-label . 0) (label . 0)
(brace-list-intro first
c-lineup-2nd-brace-entry-in-arglist
c-lineup-class-decl-init-+ +)
(statement-cont . +)))
("whitesmith" (c-basic-offset . 4) (c-comment-only-line-offset . 0)
(c-offsets-alist (defun-open . +)
(defun-close . c-lineup-whitesmith-in-block)
(defun-block-intro add c-lineup-whitesmith-in-block
c-indent-multi-line-block)
(class-open . +) (class-close . +)
(inline-open . +)
(inline-close . c-lineup-whitesmith-in-block)
(knr-argdecl-intro . +) (block-open . 0)
(block-close . c-lineup-whitesmith-in-block)
(brace-list-open . +)
(brace-list-close . c-lineup-whitesmith-in-block)
(brace-list-intro add c-lineup-whitesmith-in-block
c-indent-multi-line-block)
(brace-list-entry add
c-lineup-after-whitesmith-blocks
c-indent-multi-line-block)
(brace-entry-open add
c-lineup-after-whitesmith-blocks
c-indent-multi-line-block)
(statement add c-lineup-after-whitesmith-blocks
c-indent-multi-line-block)
(statement-block-intro add
c-lineup-whitesmith-in-block
c-indent-multi-line-block)
(substatement-open . +) (substatement-label . +)
(label . 0)
(arglist-intro add c-lineup-whitesmith-in-block
c-indent-multi-line-block)
(arglist-cont add c-lineup-after-whitesmith-blocks
c-indent-multi-line-block)
(arglist-cont-nonempty add
c-lineup-whitesmith-in-block
c-indent-multi-line-block)
(arglist-close . c-lineup-whitesmith-in-block)
(inclass . c-lineup-whitesmith-in-block)
(extern-lang-open . +) (namespace-open . +)
(module-open . +) (composition-open . +)
(extern-lang-close . +) (namespace-close . +)
(module-close . +) (composition-close . +)
(inextern-lang . c-lineup-whitesmith-in-block)
(innamespace . c-lineup-whitesmith-in-block)
(inmodule . c-lineup-whitesmith-in-block)
(incomposition . c-lineup-whitesmith-in-block)
(inexpr-class . 0)))
("ellemtel" (c-basic-offset . 3) (c-comment-only-line-offset . 0)
(c-hanging-braces-alist (substatement-open before after)
(arglist-cont-nonempty))
(c-offsets-alist (topmost-intro . 0) (substatement . +)
(substatement-open . 0) (case-label . +)
(access-label . -) (inclass . +) (inline-open . 0)))
("linux" (indent-tabs-mode . t) (c-basic-offset . 8)
(c-comment-only-line-offset . 0)
(c-hanging-braces-alist (brace-list-open) (brace-entry-open)
(substatement-open after)
(block-close . c-snug-do-while)
(arglist-cont-nonempty))
(c-cleanup-list brace-else-brace)
(c-offsets-alist (statement-block-intro . +) (knr-argdecl-intro . 0)
(substatement-open . 0) (substatement-label . 0)
(label . 0) (statement-cont . +)))
("python" (indent-tabs-mode . t) (fill-column . 78)
(c-basic-offset . 8)
(c-offsets-alist (substatement-open . 0) (inextern-lang . 0)
(arglist-intro . +)
(brace-list-intro first
c-lineup-2nd-brace-entry-in-arglist
c-lineup-class-decl-init-+ +)
(knr-argdecl-intro . +))
(c-hanging-braces-alist (brace-list-open) (brace-list-intro)
(brace-list-close) (brace-entry-open)
(substatement-open after)
(block-close . c-snug-do-while)
(arglist-cont-nonempty))
(c-block-comment-prefix . ""))
("java" (c-basic-offset . 4) (c-comment-only-line-offset 0 . 0)
(c-offsets-alist (inline-open . 0) (topmost-intro-cont . +)
(statement-block-intro . +) (knr-argdecl-intro . 5)
(substatement-open . +) (substatement-label . +)
(label . +) (statement-case-open . +)
(statement-cont . +)
(arglist-intro . c-lineup-arglist-intro-after-paren)
(arglist-close . c-lineup-arglist-close-under-paren)
(brace-list-intro first
c-lineup-2nd-brace-entry-in-arglist
c-lineup-class-decl-init-+ +)
(access-label . 0)
(inher-cont . c-lineup-java-inher)
(func-decl-cont . c-lineup-java-throws)))
("awk" (c-basic-offset . 4) (c-comment-only-line-offset . 0)
(c-hanging-braces-alist (defun-open after)
(defun-close . c-snug-1line-defun-close)
(substatement-open after)
(block-close . c-snug-do-while)
(arglist-cont-nonempty))
(c-hanging-semi&comma-criteria) (c-cleanup-list)
(c-offsets-alist (statement-block-intro . +) (substatement-open . 0)
(statement-cont . +))))
Documentation
Styles of indentation.
Elements of this alist are of the form:
(STYLE-STRING [BASE-STYLE] (VARIABLE . VALUE) [(VARIABLE . VALUE) ...])
where STYLE-STRING is a short descriptive string used to select a style, VARIABLE is any Emacs variable, and VALUE is the intended value for that variable when using the selected style.
Optional BASE-STYLE if present, is a string and must follow STYLE-STRING. BASE-STYLE names a style that this style inherits from. By default, all styles inherit from the "user" style, which is computed at run time. Style loops generate errors.
Two variables are treated specially. When VARIABLE is
c-offsets-alist, the VALUE is a list containing elements of the
form:
(SYNTACTIC-SYMBOL . OFFSET)
as described in c-offsets-alist. These are passed directly to
c-set-offset so there is no need to set every syntactic symbol in
your style, only those that are different from the default.
When VARIABLE is c-special-indent-hook, its VALUE is added to
c-special-indent-hook using add-hook. If VALUE is a list, each
element of the list is added with add-hook.
Do not change this variable directly. Use the function c-add-style
to add new styles or modify existing styles (it is not a good idea to
modify existing styles -- you should create a new style that inherits
the existing style).
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/cc-styles.el.gz
(defvar c-style-alist
'(("gnu"
(c-basic-offset . 2)
(c-comment-only-line-offset . (0 . 0))
(c-hanging-braces-alist . ((substatement-open before after)
(arglist-cont-nonempty)))
(c-offsets-alist . ((statement-block-intro . +)
(knr-argdecl-intro . 5)
(substatement-open . +)
(substatement-label . 0)
(label . 0)
(statement-case-open . +)
(statement-cont . +)
(arglist-intro . c-lineup-arglist-intro-after-paren)
(arglist-close . c-lineup-arglist-close-under-paren)
(inline-open . 0)
(brace-list-open . +)
(brace-list-intro . (first
c-lineup-2nd-brace-entry-in-arglist
c-lineup-class-decl-init-+ +))
(topmost-intro-cont
. (first c-lineup-topmost-intro-cont
c-lineup-gnu-DEFUN-intro-cont))))
(c-special-indent-hook . c-gnu-impose-minimum)
(c-block-comment-prefix . ""))
("k&r"
(c-basic-offset . 5)
(c-comment-only-line-offset . 0)
(c-offsets-alist . ((statement-block-intro . +)
(knr-argdecl-intro . 0)
(substatement-open . 0)
(substatement-label . 0)
(label . 0)
(statement-cont . +))))
("bsd"
(c-basic-offset . 8)
(c-comment-only-line-offset . 0)
(c-offsets-alist . ((statement-block-intro . +)
(knr-argdecl-intro . +)
(substatement-open . 0)
(substatement-label . 0)
(label . 0)
(statement-cont . +)
(inline-open . 0)
(brace-list-intro . (first
c-lineup-2nd-brace-entry-in-arglist
c-lineup-class-decl-init-+ +))
(inexpr-class . 0))))
("stroustrup"
(c-basic-offset . 4)
(c-comment-only-line-offset . 0)
(c-offsets-alist . ((statement-block-intro . +)
(substatement-open . 0)
(substatement-label . 0)
(label . 0)
(brace-list-intro . (first
c-lineup-2nd-brace-entry-in-arglist
c-lineup-class-decl-init-+ +))
(statement-cont . +))))
("whitesmith"
(c-basic-offset . 4)
(c-comment-only-line-offset . 0)
;; It's obvious that the CC Mode way of choosing anchor positions
;; doesn't fit this style at all. :P
(c-offsets-alist . ((defun-open . +)
(defun-close . c-lineup-whitesmith-in-block)
(defun-block-intro . (add c-lineup-whitesmith-in-block
c-indent-multi-line-block))
(class-open . +)
(class-close . +)
(inline-open . +)
(inline-close . c-lineup-whitesmith-in-block)
(knr-argdecl-intro . +)
(block-open . 0) ; Get indentation from `statement' instead.
(block-close . c-lineup-whitesmith-in-block)
(brace-list-open . +)
(brace-list-close . c-lineup-whitesmith-in-block)
(brace-list-intro . (add c-lineup-whitesmith-in-block
c-indent-multi-line-block))
(brace-list-entry . (add c-lineup-after-whitesmith-blocks
c-indent-multi-line-block))
(brace-entry-open . (add c-lineup-after-whitesmith-blocks
c-indent-multi-line-block))
(statement . (add c-lineup-after-whitesmith-blocks
c-indent-multi-line-block))
(statement-block-intro . (add c-lineup-whitesmith-in-block
c-indent-multi-line-block))
(substatement-open . +)
(substatement-label . +)
(label . 0)
(arglist-intro . (add c-lineup-whitesmith-in-block
c-indent-multi-line-block))
(arglist-cont . (add c-lineup-after-whitesmith-blocks
c-indent-multi-line-block))
(arglist-cont-nonempty . (add c-lineup-whitesmith-in-block
c-indent-multi-line-block))
(arglist-close . c-lineup-whitesmith-in-block)
(inclass . c-lineup-whitesmith-in-block)
(extern-lang-open . +)
(namespace-open . +)
(module-open . +)
(composition-open . +)
(extern-lang-close . +)
(namespace-close . +)
(module-close . +)
(composition-close . +)
(inextern-lang . c-lineup-whitesmith-in-block)
(innamespace . c-lineup-whitesmith-in-block)
(inmodule . c-lineup-whitesmith-in-block)
(incomposition . c-lineup-whitesmith-in-block)
(inexpr-class . 0))))
("ellemtel"
(c-basic-offset . 3)
(c-comment-only-line-offset . 0)
(c-hanging-braces-alist . ((substatement-open before after)
(arglist-cont-nonempty)))
(c-offsets-alist . ((topmost-intro . 0)
(substatement . +)
(substatement-open . 0)
(case-label . +)
(access-label . -)
(inclass . +)
(inline-open . 0))))
("linux"
(indent-tabs-mode . t)
(c-basic-offset . 8)
(c-comment-only-line-offset . 0)
(c-hanging-braces-alist . ((brace-list-open)
(brace-entry-open)
(substatement-open after)
(block-close . c-snug-do-while)
(arglist-cont-nonempty)))
(c-cleanup-list . (brace-else-brace))
(c-offsets-alist . ((statement-block-intro . +)
(knr-argdecl-intro . 0)
(substatement-open . 0)
(substatement-label . 0)
(label . 0)
(statement-cont . +))))
("python"
(indent-tabs-mode . t)
(fill-column . 78)
(c-basic-offset . 8)
(c-offsets-alist . ((substatement-open . 0)
(inextern-lang . 0)
(arglist-intro . +)
(brace-list-intro . (first
c-lineup-2nd-brace-entry-in-arglist
c-lineup-class-decl-init-+ +))
(knr-argdecl-intro . +)))
(c-hanging-braces-alist . ((brace-list-open)
(brace-list-intro)
(brace-list-close)
(brace-entry-open)
(substatement-open after)
(block-close . c-snug-do-while)
(arglist-cont-nonempty)))
(c-block-comment-prefix . ""))
("java"
(c-basic-offset . 4)
(c-comment-only-line-offset . (0 . 0))
;; the following preserves Javadoc starter lines
(c-offsets-alist . ((inline-open . 0)
(topmost-intro-cont . +)
(statement-block-intro . +)
(knr-argdecl-intro . 5)
(substatement-open . +)
(substatement-label . +)
(label . +)
(statement-case-open . +)
(statement-cont . +)
(arglist-intro . c-lineup-arglist-intro-after-paren)
(arglist-close . c-lineup-arglist-close-under-paren)
(brace-list-intro . (first
c-lineup-2nd-brace-entry-in-arglist
c-lineup-class-decl-init-+ +))
(access-label . 0)
(inher-cont . c-lineup-java-inher)
(func-decl-cont . c-lineup-java-throws))))
;; awk style exists primarily for auto-newline settings. Otherwise it's
;; pretty much like k&r.
("awk"
(c-basic-offset . 4)
(c-comment-only-line-offset . 0)
(c-hanging-braces-alist . ((defun-open after)
(defun-close . c-snug-1line-defun-close)
(substatement-open after)
(block-close . c-snug-do-while)
(arglist-cont-nonempty)))
(c-hanging-semi&comma-criteria . nil)
(c-cleanup-list . nil) ; You might want one-liner-defun here.
(c-offsets-alist . ((statement-block-intro . +)
(substatement-open . 0)
(statement-cont . +))))
)
"Styles of indentation.
Elements of this alist are of the form:
(STYLE-STRING [BASE-STYLE] (VARIABLE . VALUE) [(VARIABLE . VALUE) ...])
where STYLE-STRING is a short descriptive string used to select a
style, VARIABLE is any Emacs variable, and VALUE is the intended value
for that variable when using the selected style.
Optional BASE-STYLE if present, is a string and must follow
STYLE-STRING. BASE-STYLE names a style that this style inherits from.
By default, all styles inherit from the \"user\" style, which is
computed at run time. Style loops generate errors.
Two variables are treated specially. When VARIABLE is
`c-offsets-alist', the VALUE is a list containing elements of the
form:
(SYNTACTIC-SYMBOL . OFFSET)
as described in `c-offsets-alist'. These are passed directly to
`c-set-offset' so there is no need to set every syntactic symbol in
your style, only those that are different from the default.
When VARIABLE is `c-special-indent-hook', its VALUE is added to
`c-special-indent-hook' using `add-hook'. If VALUE is a list, each
element of the list is added with `add-hook'.
Do not change this variable directly. Use the function `c-add-style'
to add new styles or modify existing styles (it is not a good idea to
modify existing styles -- you should create a new style that inherits
the existing style).")