www.delorie.com/gnu/docs/emacs/cc-mode_26.html   search  
Buy the book!

CC Mode Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.4.3 File Styles

The Emacs manual describes how you can customize certain variables on a per-file basis by including a Local Variable block at the end of the file. So far, you've only seen a functional interface to CC Mode customization, which is highly inconvenient for use in a Local Variable block. CC Mode provides two variables that make it easier for you to customize your style on a per-file basis.

The variable c-file-style can be set to a style name string. When the file is visited, CC Mode will automatically set the file's style to this style using c-set-style.

Another variable, c-file-offsets, takes an association list similar to what is allowed in c-offsets-alist. When the file is visited, CC Mode will automatically institute these offsets using c-set-offset.

Note that file style settings (i.e. c-file-style) are applied before file offset settings (i.e. c-file-offsets). Also, if either of these are set in a file's local variable section, all the style variable values are made local to that buffer.

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003