Variables for C Indent Custom C Indent
A C style is a collection of indentation style customizations.
Emacs comes with several predefined indentation styles for C and related
cc-mode. The default style is
To choose the style you want, use the command M-x c-set-style.
Specify a style name as an argument (case is not significant in C style
names). The chosen style only affects newly visited buffers, not those
you are already editing. You can also set the variable
c-default-style to specify the style for various major modes.
Its value should be an alist, in which each element specifies one major
mode and which indentation style to use for it. For example,
(setq c-default-style '((java-mode . "java") (other . "gnu")))
specifies an explicit choice for Java mode, and the default `
style for the other C-like modes.
To define a new C indentation style, call the function
(c-add-style name values use-now)
Here name is the name of the new style (a string), and
values is an alist whose elements have the form
(variable . value). The variables you specify should
be among those documented in Variables for C Indent.
If use-now is non-
c-add-style switches to the
new style after defining it.