When you create a new buffer, its style will be set from
c-default-style
. The factory default is the style gnu
,
except in Java and AWK modes where it’s java
and awk
.
Remember that if you set a style variable with the Customization interface or at the top level of your .emacs file before the style system is initialized (see Configuration Basics), this setting will override the one that the style system would have given the variable.
To set a buffer’s style interactively, use the command C-c . (see Other Commands). To set it from a file’s local variable list, File Styles.
This variable specifies which style to install by default in new buffers. It takes either a style name string, or an association list of major mode symbols to style names:
c-default-style
is a string, it must be an existing style
name. This style is then used for all modes.
c-default-style
is an association list, the mode language
is looked up to find a style name string.
c-default-style
is an association list where the mode
language mode isn’t found then the special symbol ‘other’ is
looked up. If it’s found then the associated style is used.
In all cases, the style described in c-default-style
is installed
before the language hooks are run, so you can always override
this setting by including an explicit call to c-set-style
in your
language mode hook, or in c-mode-common-hook
.
The standard value of c-default-style
is ((java-mode . "java") (awk-mode . "awk") (other . "gnu"))
.
This variable always contains the buffer’s current style name, as a string.