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


CC Mode Manual

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

7.4.2 Adding Styles

If none of the built-in styles is appropriate, you'll probably want to add a new style definition. Styles are kept in the c-style-alist variable, but you should never modify this variable directly. Instead, CC Mode provides the function c-add-style that you can use to easily add new styles or change existing styles. This function takes two arguments, a stylename string, and an association list description of style customizations. If stylename is not already in c-style-alist, the new style is added, otherwise the style is changed to the new description. This function also takes an optional third argument, which if non-nil, automatically applies the new style to the current buffer.

The sample `.emacs' file provides a concrete example of how a new style can be added and automatically set. See section D. Sample .emacs file.


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