]> code.delx.au - gnu-emacs/blobdiff - man/cc-mode.texi
($(EMACS)): Use $(THISDIR) instead of . in
[gnu-emacs] / man / cc-mode.texi
index ac063d4abe5c8c03759c7e5beb38fd25caf31f71..e4b9c7a218f7d46d958c81b38403e9af26c3c74d 100644 (file)
 @comment Generated from the original README file by Krishna Padmasola
 @comment <krishna@earth-gw.njit.edu>
 @comment 
-@comment Maintained by Barry A. Warsaw and Martin Stjernholm
-@comment <bug-cc-mode@gnu.org> (or <cc-mode-help@python.org>)
+@comment Maintained by Martin Stjernholm <bug-cc-mode@gnu.org>
 @comment 
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
+@comment Info directory entry for use by install-info
+@dircategory Emacs
+@direntry
+* CC Mode: (ccmode).    Emacs mode for editing C, C++, Objective-C,
+                          Java, Pike, and IDL code.
+@end direntry
 
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 @comment The following line inserts the copyright notice 
 @comment into the Info file.
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-@ifinfo
-Copyright @copyright{} 1995,1996,1997,1998,1999 Free Software Foundation, Inc.
-@end ifinfo
+@ifnottex
+Copyright @copyright{} 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 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.
+@end ifnottex
 
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 @comment !!!The titlepage section does not appear in the Info file.!!!
@@ -50,11 +73,11 @@ Copyright @copyright{} 1995,1996,1997,1998,1999 Free Software Foundation, Inc.
 @comment The title is printed in a large font.
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-@center @titlefont{CC Mode 5.26}
+@center @titlefont{CC Mode 5.27}
 @sp 2
 @center @subtitlefont{A GNU Emacs mode for editing C and C-like languages}
 @sp 2
-@center Barry A. Warsaw
+@center Current maintainer:
 @center Martin Stjernholm
 
 
@@ -65,7 +88,25 @@ Copyright @copyright{} 1995,1996,1997,1998,1999 Free Software Foundation, Inc.
 
 @page
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1995,1996,1997,1998,1999 Free Software Foundation, Inc.
+Copyright @copyright{} 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+@sp 1
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.1 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.
 @end titlepage
 
 
@@ -184,10 +225,11 @@ milestone in the mode's life.  It has been fully merged back with Emacs
 19's @file{c-mode.el}. Also a new, more intuitive and flexible mechanism
 for controlling indentation has been developed.  Late in 1997, Martin
 joined the @ccmode{} Maintainers Team, and implemented the Pike support.
+As of 2000 Martin has taken over as the sole maintainer.
 
 This manual describes @ccmode{}
 @comment The following line must appear on its own, so that the automated
-version 5.26.
+version 5.27.
 @comment Release.py script can update the version number automatically
 
 @ccmode{} supports the editing of K&R and ANSI C, @dfn{ARM}
@@ -605,7 +647,7 @@ to your @file{.emacs} file:
 @example
 
 (add-hook 'c-mode-common-hook
-         '(lambda () (c-toggle-auto-hungry-state 1)))
+         (lambda () (c-toggle-auto-hungry-state 1)))
 
 @end example
 
@@ -1276,7 +1318,7 @@ E. Jones' Filladapt package@footnote{It's available from
 lack a feature that makes it work suboptimally when
 @code{c-comment-prefix-regexp} matches the empty string (which it does
 by default).  A patch for that is available from
-@uref{http://www.python.org/emacs/cc-mode/,, the CC Mode site}.},
+@uref{http://cc-mode.sourceforge.net/,, the CC Mode site}.},
 which handles things like bulleted lists nicely.  There's a convenience
 function @code{c-setup-filladapt} that tunes the relevant variables in
 Filladapt for use in @ccmode{}.  Call it from a mode hook, e.g. with
@@ -2016,12 +2058,13 @@ this manual does not cover how that works.
 
 Variables set like this at the top level in @file{.emacs} take effect in
 all @ccmode{} buffers, regardless of language.  The indentation style
-related variables that you don't set get their value from the style
-system (@pxref{Styles}), and they therefore depend on the setting of
-@code{c-default-style}.  Note that if you use Customize, this means that
-the greyed-out default values presented there might not be the ones you
-actually get, since the actual values depend on the style, which may
-very well be different for different languages.
+related variables, e.g. @code{c-basic-offset}, that you don't set this
+way get their value from the style system (@pxref{Styles}), and they
+therefore depend on the setting of @code{c-default-style}.  Note that if
+you use Customize, this means that the greyed-out default values
+presented there might not be the ones you actually get, since the actual
+values depend on the style, which may very well be different for
+different languages.
 
 If you want to make more advanced configurations, e.g. language-specific
 customization, global variable settings isn't enough.  For that you can
@@ -3450,46 +3493,52 @@ The lines to note in this example include:
 
 @cindex func-decl-cont syntactic symbol
 @item
-line 2, assigned the @code{func-decl-cont} syntax;
+Line 2 is assigned the @code{func-decl-cont} syntax.
 
 @cindex comment-intro syntactic symbol
 @item
-line 4, assigned both @code{defun-block-intro} @emph{and}
-@code{comment-intro} syntax;
+Line 4 is assigned both @code{defun-block-intro} @emph{and}
+@code{comment-intro} syntax.
 
 @cindex c syntactic symbol
 @item
-line 5, assigned @code{c} syntax;
+Line 5 is assigned @code{c} syntax.
 
 @item
 @cindex syntactic whitespace
-line 6 which, even though it contains nothing but whitespace, is
+Line 6 which, even though it contains nothing but whitespace, is
 assigned @code{defun-block-intro}.  Note that the appearance of the
 comment on lines 4 and 5 do not cause line 6 to be assigned
 @code{statement} syntax because comments are considered to be
 @dfn{syntactic whitespace}, which are ignored when analyzing
-code;
+code.
 
 @cindex string syntactic symbol
 @item
-line 8, assigned @code{string} syntax;
+Line 8 is assigned @code{string} syntax.
 
 @cindex label syntactic symbol
 @item
-line 10, assigned @code{label} syntax;
+Line 10 is assigned @code{label} syntax.
 
 @cindex block-open syntactic symbol
 @item
-line 11, assigned @code{block-open} syntax;
+Line 11 is assigned @code{block-open} syntax.
 
 @cindex cpp-macro syntactic symbol
 @cindex cpp-macro-cont syntactic symbol
 @item
-lines 12 and 14, assigned @code{cpp-macro} syntax.
+Lines 12 and 14 are assigned @code{cpp-macro} syntax in addition to the
+normal syntactic symbols (@code{statement-block-intro} and
+@code{statement}, respectively).  Normally @code{cpp-macro} is
+configured to cancel out the normal syntactic context to make all
+preprocessor directives stick to the first column, but that's easily
+changed if you want preprocessor directives to be indented like the rest
+of the code.
 
 @cindex stream-op syntactic symbol
 @item
-line 17, assigned @code{stream-op} syntax.
+Line 17 is assigned @code{stream-op} syntax.
 
 @end itemize
 
@@ -3754,10 +3803,41 @@ Line up C++ stream operators (i.e. @samp{<<} and @samp{>>}).
 @findex c-lineup-multi-inher
 @findex lineup-multi-inher (c-)
 @item c-lineup-multi-inher
-Line up the classes in C++ multiple inheritance clauses under each
-other.
+Line up the classes in C++ multiple inheritance clauses and member
+initializers under each other.  E.g:
+@example
+@group
 
-@workswith @code{inher-cont}.
+Foo::Foo (int a, int b):
+    Cyphr (a),
+    Bar (b)              // c-lineup-multi-inher
+
+@end group
+@end example
+@noindent
+and
+@example
+@group
+
+class Foo
+    : public Cyphr,
+      public Bar         // c-lineup-multi-inher
+
+@end group
+@end example
+@noindent
+and
+@example
+@group
+
+Foo::Foo (int a, int b)
+    : Cyphr (a)
+    , Bar (b)            // c-lineup-multi-inher
+
+@end group
+@end example
+
+@workswith @code{inher-cont}, @code{member-init-cont}.
 
 @findex c-lineup-java-inher
 @findex lineup-java-inher (c-)
@@ -4267,11 +4347,9 @@ of putting the @code{c-set-offset} line in your top-level
 @file{.emacs} file, put it in your @code{c-mode-common-hook}, or
 simply modify @code{c-offsets-alist} directly:
 @example
-@group
 
-(setq c-offsets-alist (cons '(substatement-open . 0)
-                            c-offsets-alist))
-@end group
+(setq c-offsets-alist '((substatement-open . 0)))
+
 @end example
 
 @sp 1
@@ -4343,7 +4421,7 @@ compatibility, etc. are all available via the Web at:
 @example
 @group
 
-        @uref{http://www.python.org/emacs/cc-mode/}
+        @uref{http://cc-mode.sourceforge.net/}
 
 @end group
 @end example
@@ -4389,8 +4467,7 @@ the individual files, including PostScript documentation.
   "My C Programming Style")
 
 ;; offset customizations not in my-c-style
-(setq c-offsets-alist (cons '(member-init-intro . ++)
-                            c-offsets-alist))
+(setq c-offsets-alist '((member-init-intro . ++)))
 
 ;; Customizations for all modes in CC Mode.
 (defun my-c-mode-common-hook ()
@@ -4481,20 +4558,16 @@ Bug reports are now sent to the following email addresses:
 latter is mirrored on the Usenet newsgroup @code{gnu.emacs.bug}.  You
 can send other questions and suggestions (kudos? @t{;-)} to
 @email{bug-cc-mode@@gnu.org}, or @email{help-gnu-emacs@@gnu.org} which is
-mirrored on newsgroup @code{gnu.emacs.help}.  The old contact address
-@email{cc-mode-help@@python.org} is still active, but its use is
-discouraged.
+mirrored on newsgroup @code{gnu.emacs.help}.
 
 @cindex beta testers mailing list
 @cindex announcement mailing list
-If you want to get announcements of new @ccmode{} releases, send the word
-@emph{subscribe} in the body of a message to
-@email{cc-mode-announce-request@@python.org}.  Announcements will also
-be posted to the Usenet newsgroups @code{gnu.emacs.sources},
+If you want to get announcements of new @ccmode{} releases, send the
+word @emph{subscribe} in the body of a message to
+@email{cc-mode-announce-request@@lists.sourceforge.net}.  Announcements
+will also be posted to the Usenet newsgroups @code{gnu.emacs.sources},
 @code{comp.emacs}, @code{comp.emacs.xemacs}, and possibly some of the
-language oriented newsgroups.  Note that the
-@code{cc-mode-victims@@python.org} mailing list has been
-decommissioned.
+language oriented newsgroups.
 
 
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!