This manual is for CC Mode in Emacs.
Copyright @copyright{} 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with the
-Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
-``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
-Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
-license is included in the section entitled ``GNU Free Documentation
-License'' in the Emacs manual.
-
-(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
-this GNU Manual, like GNU software. Copies published by the Free
-Software Foundation raise funds for GNU development.''
-
-This document is part of a collection distributed under the GNU Free
-Documentation License. If you want to distribute this document
-separately from the collection, you can do so by adding a copy of the
-license to the document, as described in section 6 of the license.
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
+and with the Back-Cover Texts as in (a) below. A copy of the license
+is included in the section entitled ``GNU Free Documentation License''.
+
+(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
+modify this GNU manual. Buying copies from the FSF supports it in
+developing GNU and promoting software freedom.''
@end quotation
@end copying
@comment here is by request from the FSF folks.
@dircategory Emacs
@direntry
-* CC Mode: (ccmode). Emacs mode for editing C, C++, Objective-C,
- Java, Pike, AWK, and CORBA IDL code.
+* CC Mode: (ccmode). Emacs mode for editing C, C++, Objective-C,
+ Java, Pike, AWK, and CORBA IDL code.
@end direntry
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@comment This appears only in the Info file, not the printed manual.
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+@summarycontents
+@contents
+
@node Top, Introduction, (dir), (dir)
@comment node-name, next, previous, up
-@ifinfo
+@ifnottex
@top @ccmode{}
@ccmode{} is a GNU Emacs mode for editing files containing C, C++,
has several handy commands and some minor modes to make the editing
easier. It does not provide tools to look up and navigate between
functions, classes etc - there are other packages for that.
-@end ifinfo
+
+@insertcopying
+@end ifnottex
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
have the latest @ccmode{} release and might want to upgrade your copy
(see below).
-You should probably start by skimming through the entire chapter
-@ref{Commands} to get an overview of @ccmode{}'s capabilities.
+You should probably start by skimming through the entire Commands chapter
+(@pxref{Commands}) to get an overview of @ccmode{}'s capabilities.
After trying out some commands, you may dislike some aspects of
@ccmode{}'s default configuration. Here is an outline of how to
If @var{n} is negative, move in the opposite direction.
Note that these two commands have been superseded by
-@code{c-subword-mode}, which you should use instead. @xref{Subword
+@code{subword-mode}, which you should use instead. @xref{Subword
Movement}. They might be removed from a future release of @ccmode{}.
@end table
@findex toggle-auto-hungry-state (c-)
Toggle both auto-newline and hungry delete minor modes.
-@item @kbd{C-c C-w} (@code{M-x c-subword-mode})
+@item @kbd{C-c C-w} (@code{M-x subword-mode})
@kindex C-c C-w
-@findex c-subword-mode
-@findex subword-mode (c-)
+@findex subword-mode
Toggle subword mode.
@item @kbd{M-x c-toggle-syntactic-indentation}
@example
(add-hook 'c-mode-common-hook
- (lambda () (c-subword-mode 1)))
+ (lambda () (subword-mode 1)))
@end example
-As a bonus, you can also use @code{c-subword-mode} in non-@ccmode{}
-buffers by typing @kbd{M-x c-subword-mode}.
+As a bonus, you can also use @code{subword-mode} in non-@ccmode{}
+buffers by typing @kbd{M-x subword-mode}.
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@node Other Commands, , Subword Movement, Commands
@item
@table @asis
@item Style
+@itemx File Style@footnote{In earlier versions of @ccmode{}, a File Style setting took precedence over any other setting apart from a File Local Variable setting.}
@itemx Top-level command or ``customization interface''
@itemx Hook
-@itemx File Style
+@itemx File Local Variable setting
@end table
@end itemize
See @ref{Styles} for fuller details on using @ccmode{} styles and how
to create them.
+@item File Local Variable setting
+A @dfn{file local variable setting} is a setting which applies to an
+individual source file. You put this in a @dfn{local variables list},
+a special block at the end of the source file (@pxref{Specifying File
+Variables,,, @emacsman{}}).
+
@item File Styles
A @dfn{file style} is a rarely used variant of the ``style'' mechanism
-described above, which applies to an individual source file. To use
-it, you set certain Emacs local variables in a special block at the
-end of the source file. @xref{File Styles}.
+described above, which applies to an individual source file.
+@xref{File Styles}. You use this by setting certain special variables
+in a local variables list (@pxref{Specifying File Variables,,,
+@emacsman{}}).
@item Hooks with Styles
For ultimate flexibility, you can use hooks and styles together. For
Remember that if you set a style variable with the Customization
interface or at the top level of your @file{.emacs} file before the
-style system is initialised (@pxref{Config Basics}), this setting will
+style system is initialized (@pxref{Config 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 @kbd{C-c .}
variable is virtually always non-@code{nil} anyhow, you're unlikely to
notice this effect.}.
-If you set any variables, including style variables, by the file local
-variables mechanism, these settings take priority over all other
-settings, even those in your mode hooks (@pxref{CC Hooks}). If you
-use @code{c-file-style} or @code{c-file-offsets} and also explicitly
-set a style variable in a local variable block, the explicit setting
-will take priority.
-
+If you set any variable by the file local variables mechanism, that
+setting takes priority over all other settings, even those in your
+mode hooks (@pxref{CC Hooks}). Any individual setting of a variable
+will override one made through @code{c-file-style} or
+@code{c-file-offsets}.
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@node Custom Filling and Breaking, Custom Auto-newlines, Config Basics, Top
@comment node-name, next, previous, up
isn't found then the special symbol @samp{other} is looked up instead.
When a comment line gets divided by @kbd{M-j} or the like, @ccmode{}
-inserts the comment line prefix from a neighbouring line at the start
+inserts the comment line prefix from a neighboring line at the start
of the new line. The default value of c-comment-prefix-regexp is
@samp{//+\\|\\**}, which matches C++ style line comments like
Only continuation lines like this are touched, @code{nil} is returned on
lines which are the start of an argument.
-Within a gcc @code{asm} block, @code{:} is recognised as an argument
+Within a gcc @code{asm} block, @code{:} is recognized as an argument
separator, but of course only between operand specifications, not in the
expressions for the operands.
templates do not fare so well. Sometimes a workaround is to refontify
the expression after typing the closing @samp{>}.
+@item
+In a @dfn{k&r region} (the part of an old-fashioned C function
+declaration which specifies the types of its parameters, coming
+between the parameter list and the opening brace), there should be at
+most 20 top-level parenthesis and bracket pairs. This limit has been
+imposed for performance reasons. If it is violated, the source file
+might be incorrectly indented or fontified.
+
@item
On loading @ccmode{}, sometimes this error message appears:
@comment Epilogue.
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-@iftex
-@page
-@summarycontents
-@contents
-@end iftex
-
@bye
@ignore