@setfilename ../../info/ccmode
@settitle CC Mode Manual
+@documentencoding UTF-8
@footnotestyle end
@c The following four macros generate the filenames and titles of the
@copying
This manual is for CC Mode in Emacs.
-Copyright @copyright{} 1995--2012 Free Software Foundation, Inc.
+Copyright @copyright{} 1995--2014 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
@dircategory Emacs editing modes
@direntry
* CC Mode: (ccmode). Emacs mode for editing C, C++, Objective-C,
- Java, Pike, AWK, and CORBA IDL code.
+ Java, Pike, AWK, and CORBA IDL code.
@end direntry
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@center @titlefont{CC Mode 5.32}
@sp 2
-@center @subtitlefont{A GNU Emacs mode for editing C and C-like languages}
+@center A GNU Emacs mode for editing C and C-like languages
@sp 2
@center Barry A. Warsaw, Martin Stjernholm, Alan Mackenzie
* Customizing Indentation::
* Custom Macros::
* Odds and Ends::
-* Sample .emacs File::
+* Sample Init File::
* Performance Issues::
* Limitations and Known Bugs::
* FAQ::
This function is not bound to a key by default, but it's intended to be
used on the @kbd{RET} key. If you like the behavior of
@code{newline-and-indent} on @kbd{RET}, you should consider switching to
-this function. @xref{Sample .emacs File}.
+this function. @xref{Sample Init File}.
@item @kbd{M-x c-context-open-line}
@findex c-context-open-line
You can toggle each of these minor modes on and off, and you can
configure @ccmode{} so that it starts up with your favorite
-combination of them (@pxref{Sample .emacs File}). By default, when
+combination of them (@pxref{Sample Init File}). By default, when
you initialize a buffer, electric mode and syntactic-indentation mode
are enabled but the other two modes are disabled.
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
The general appearance of font-locking in AWK mode is much like in any
-other programming mode. @xref{Faces For Font Lock,,,elisp, GNU Emacs
+other programming mode. @xref{Faces for Font Lock,,,elisp, GNU Emacs
Lisp Reference Manual}.
The following faces are, however, used in a non-standard fashion in
@vindex initialization-hook (c-)
Hook run only once per Emacs session, when @ccmode{} is initialized.
This is a good place to change key bindings (or add new ones) in any
-of the @ccmode{} key maps. @xref{Sample .emacs File}.
+of the @ccmode{} key maps. @xref{Sample Init File}.
@end defvar
@defvar c-mode-common-hook
Here's a simplified example of what you can add to your @file{.emacs}
file to do things whenever any @ccmode{} language is edited. See the
Emacs manuals for more information on customizing Emacs via hooks.
-@xref{Sample .emacs File}, for a more complete sample @file{.emacs}
+@xref{Sample Init File}, for a more complete sample @file{.emacs}
file.
@example
style. To do this, put the new style's settings into a list with the
following format; the list can then be passed as an argument to the
function @code{c-add-style}. You can see an example of a style
-definition in @ref{Sample .emacs File}.
+definition in @ref{Sample Init File}.
@cindex style definition
@c @defvr {List} style definition
You should use @code{c-set-style} instead.
The sample @file{.emacs} file provides a concrete example of how a new
-style can be added and automatically set. @xref{Sample .emacs File}.
+style can be added and automatically set. @xref{Sample Init File}.
@end defun
@defvar c-style-alist
There are a few occasions where a statement block might be used inside
an expression. One is in C or C++ code using the gcc extension for
-this, e.g:
+this, e.g.:
@example
1: int res = (@{
@findex lineup-close-paren (c-)
Line up the closing paren under its corresponding open paren if the
open paren is followed by code. If the open paren ends its line, no
-indentation is added. E.g:
+indentation is added. E.g.:
@example
@group
@defun c-indent-one-line-block
@findex indent-one-line-block (c-)
-Indent a one line block @code{c-basic-offset} extra. E.g:
+Indent a one line block @code{c-basic-offset} extra. E.g.:
@example
@group
@defun c-indent-multi-line-block
@findex indent-multi-line-block (c-)
-Indent a multiline block @code{c-basic-offset} extra. E.g:
+Indent a multiline block @code{c-basic-offset} extra. E.g.:
@example
@group
Line up statements for coding standards which place the first statement
in a block on the same line as the block opening brace@footnote{Run-in
style doesn't really work too well. You might need to write your own
-custom line-up functions to better support this style.}. E.g:
+custom line-up functions to better support this style.}. E.g.:
@example
@group
@defun c-lineup-whitesmith-in-block
@findex lineup-whitesmith-in-block (c-)
Line up lines inside a block in Whitesmith style. It's done in a way
-that works both when the opening brace hangs and when it doesn't. E.g:
+that works both when the opening brace hangs and when it doesn't. E.g.:
@example
@group
As a special case, if an argument on the same line as the open
parenthesis starts with a brace block opener, the indentation is
@code{c-basic-offset} only. This is intended as a ``DWIM'' measure in
-cases like macros that contain statement blocks, e.g:
+cases like macros that contain statement blocks, e.g.:
@example
@group
@defun c-lineup-multi-inher
@findex lineup-multi-inher (c-)
Line up the classes in C++ multiple inheritance clauses and member
-initializers under each other. E.g:
+initializers under each other. E.g.:
@example
@group
follow on the same line as the @samp{implements}/@samp{extends}
keyword, they are lined up under each other. Otherwise, they are
indented by adding @code{c-basic-offset} to the column of the keyword.
-E.g:
+E.g.:
@example
@group
Otherwise, they are indented by adding @code{c-basic-offset} to the
column of the @samp{throws} keyword. The @samp{throws} keyword itself
is also indented by @code{c-basic-offset} from the function declaration
-start if it doesn't hang. E.g:
+start if it doesn't hang. E.g.:
@example
@group
@defun c-lineup-argcont
@findex lineup-argcont (c-)
-Line up a continued argument. E.g:
+Line up a continued argument. E.g.:
@example
@group
Line up ``cascaded calls'' under each other. If the line begins with
@code{->} or @code{.} and the preceding line ends with one or more
function calls preceded by the same token, then the arrow is lined up
-with the first of those tokens. E.g:
+with the first of those tokens. E.g.:
@example
@group
@findex lineup-string-cont (c-)
Line up a continued string under the one it continues. A continued
string in this sense is where a string literal follows directly after
-another one. E.g:
+another one. E.g.:
@example
@group
@findex lineup-knr-region-comment (c-)
Line up a comment in the ``K&R region'' with the declaration. That is
the region between the function or class header and the beginning of the
-block. E.g:
+block. E.g.:
@example
@group
@defun c-lineup-cpp-define
@findex lineup-cpp-define (c-)
Line up macro continuation lines according to the indentation of the
-construct preceding the macro. E.g:
+construct preceding the macro. E.g.:
@example
@group
statement-cont. It's used for @code{topmost-intro-cont} by default, but
you might consider using @code{+} instead.}. For lines preceding a
definition, zero is used. For other lines, @code{c-basic-offset} is
-added to the indentation. E.g:
+added to the indentation. E.g.:
@example
@group
please contact @email{bug-cc-mode@@gnu.org}.
Line-up functions are passed a single argument, the syntactic
-element (see below). The return value is a @code{c-offsets-alist}
-offset specification: for example, an integer, a symbol such as
-@code{+}, a vector, @code{nil}@footnote{Returning @code{nil} is useful
-when the offset specification for a syntactic element is a list
-containing the line-up function (@pxref{c-offsets-alist}).}, or even
-another line-up function. Full details of these are in
-@ref{c-offsets-alist}.
+element (see below). At the time of the call, point will be somewhere
+on the line being indented. The return value is a
+@code{c-offsets-alist} offset specification: for example, an integer,
+a symbol such as @code{+}, a vector, @code{nil}@footnote{Returning
+@code{nil} is useful when the offset specification for a syntactic
+element is a list containing the line-up function
+(@pxref{c-offsets-alist}).}, or even another line-up function. Full
+details of these are in @ref{c-offsets-alist}.
Line-up functions must not move point or change the content of the
buffer (except temporarily). They are however allowed to do
preserve compatibility with older configurations. In the future, we
may decide to convert to using the full list format---you can prepare
your setup for this by using the access functions
-(@code{c-langelem-sym}, etc.) described below.
+(@code{c-langelem-sym}, etc.)@: described below.
@vindex c-syntactic-element
@vindex syntactic-element (c-)
@end defun
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-@node Odds and Ends, Sample .emacs File, Custom Macros, Top
+@node Odds and Ends, Sample Init File, Custom Macros, Top
@comment node-name, next, previous, up
@chapter Odds and Ends
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-@node Sample .emacs File, Performance Issues, Odds and Ends, Top
+@node Sample Init File, Performance Issues, Odds and Ends, Top
@comment node-name, next, previous, up
-@appendix Sample .emacs File
+@appendix Sample Init File
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Here's a sample .emacs file fragment that might help you along the way.
@end verbatim
@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-@node Performance Issues, Limitations and Known Bugs, Sample .emacs File, Top
+@node Performance Issues, Limitations and Known Bugs, Sample Init File, Top
@comment node-name, next, previous, up
@chapter Performance Issues
@cindex performance