Commits

Anonymous committed 745fdee

CC-Mode 5.27

Comments (0)

Files changed (20)

 Release Announcement
-CC Mode Version 5.25
-Barry A. Warsaw and Martin Stjernholm
+CC Mode Version 5.27
+Martin Stjernholm
 <mailto:bug-cc-mode@gnu.org>
 
-This message announces the availablity of a new version of CC Mode, a
+This message announces the availability of a new version of CC Mode, a
 GNU Emacs mode for editing C (ANSI and K&R), C++, Objective-C, Java,
-CORBA's IDL, and Pike code.  A list of user visible changes is
-detailed in the NEWS file and in the URL listed below.  More
-information, including links to download the source, are available on
-the CC Mode Web page:
+CORBA's IDL, and Pike code.
 
-    <http://www.python.org/emacs/cc-mode/>
+Note that the CC Mode web home has moved from python.org to
+sourceforge.net.  Some URL:s and mail addresses have changed due to
+that; see below.
+
+A list of user visible changes is detailed in the NEWS file and in the
+URL listed below.  More information, including links to download the
+source, are available on the CC Mode web page:
+
+    <http://cc-mode.sourceforge.net/>
 
 There is also a link to the CC Mode announcement mailing list, a
 moderated list that you can join to get future release announcements.
 Please see this page for more information on this mailing list:
 
-    <http://www.python.org/mailman/listinfo/cc-mode-announce>
+    <http://lists.sourceforge.net/mailman/listinfo/cc-mode-announce>
 
 Send email correspondence to
 
     bug-cc-mode@gnu.org
 
 Note that the old address, cc-mode-help@python.org is still active,
-but it's use is discouraged.
+but its use is discouraged.
 
 For a list of changes please see
 
-    <http://www.python.org/emacs/cc-mode/changes-525.html>
+    <http://cc-mode.sourceforge.net/changes-527.php>
+2000-07-10  Andreas Jaeger  <aj@suse.de>
+
+	Release 5.27 downloaded from http://cc-mode.sourceforge.net/.
+
 1998-12-30  Martin Buchholz  <martin@xemacs.org>
 
 	* Makefile (MAINTAINER): The preferred address is bug-cc-mode@gnu.org
 Wed Feb 04 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-mode.el (c-mode, c++-mode, objc-mode, java-mode): set
- 	imenu-case-fold-search to nil.
+	imenu-case-fold-search to nil.
 
 Tue Feb 03 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-langs.el (c-postprocess-file-styles): If a file style or file
- 	offsets are set, make the variables local to the buffer (via
- 	make-local-variable).
+	offsets are set, make the variables local to the buffer (via
+	make-local-variable).
 
 	* cc-styles.el (c-make-styles-buffer-local): Take an optional
- 	argument which switches between make-variable-buffer-local and
- 	make-local-variable.  Generalize.
+	argument which switches between make-variable-buffer-local and
+	make-local-variable.  Generalize.
 
 Mon Feb 02 1998  Martin Stjernholm  <cc-mode-help@python.org>
 
 	* cc-align.el (c-lineup-close-paren, c-indent-one-line-block): New
- 	indentation functions.
+	indentation functions.
 
 	* cc-cmds.el (c-beginning-of-statement, c-end-of-statement): Do
- 	not move by sentence in strings.  Doc fixes.
+	not move by sentence in strings.  Doc fixes.
 
 	* cc-mode.texi: Document new indentation functions.
 
 Sat Jan 24 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-defs.el (c-point): In XEmacs, use scan-lists +
- 	buffer-syntactic-context-depth to radically speed up locating
- 	top-level defun opening brace in some situations.  When the braces
- 	hang, this can make c-parse-state from between 3 to 60 times
- 	faster.  When they don't hang, this may be a few percentage points
- 	slower (not noticeable to me though).  The variable
- 	c-enable-xemacs-performance-kludge-p toggles the behavior.  This
- 	change has no effect on Emacs, which lacks the built-in function
- 	buffer-syntactic-context-depth.
+	buffer-syntactic-context-depth to radically speed up locating
+	top-level defun opening brace in some situations.  When the braces
+	hang, this can make c-parse-state from between 3 to 60 times
+	faster.  When they don't hang, this may be a few percentage points
+	slower (not noticeable to me though).  The variable
+	c-enable-xemacs-performance-kludge-p toggles the behavior.  This
+	change has no effect on Emacs, which lacks the built-in function
+	buffer-syntactic-context-depth.
 
 	* cc-mode.texi: Discuss c-enable-xemacs-performance-kludge-p in
- 	the section on performance.
+	the section on performance.
 
-	* cc-vars.el (c-enable-xemacs-performance-kludge-p): New variable. 
+	* cc-vars.el (c-enable-xemacs-performance-kludge-p): New variable.
 
 Fri Jan 23 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-cmds.el cc-defs.el cc-engine.el (c-beginning-of-defun,
- 	c-indent-defun, c-parse-state): Use (c-point 'bod) instead of
- 	beginning-of-defun directly.
+	c-indent-defun, c-parse-state): Use (c-point 'bod) instead of
+	beginning-of-defun directly.
 
 Tue Jan 20 1998  Martin Stjernholm  <cc-mode-help@python.org>
 
 	* cc-cmds.el (c-beginning-of-statement): Speedup; it's only
- 	necessary to call `c-literal-limits' once when the function is
- 	entered.
+	necessary to call `c-literal-limits' once when the function is
+	entered.
 
 Mon Jan 19 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-align.el (c-semi&comma-no-newlines-before-nonblanks,
- 	c-semi&comma-no-newlines-for-oneline-inliners): New functions,
- 	appropriate for c-hanging-semi&comma-criteria, but not placed on
- 	that variable by default.
+	c-semi&comma-no-newlines-for-oneline-inliners): New functions,
+	appropriate for c-hanging-semi&comma-criteria, but not placed on
+	that variable by default.
 
 	* cc-langs.el (c-mode-base-map): Comment out c-beginning-of-defun
- 	and c-end-of-defun bindings, since RMS doesn't want these to be
- 	the default.
+	and c-end-of-defun bindings, since RMS doesn't want these to be
+	the default.
 
 	* cc-mode.texi: Describe c-beginning-of-defun and c-end-of-defun.
-  	Describe the new c-hanging-semi&comma-criteria functions.
+	Describe the new c-hanging-semi&comma-criteria functions.
 
 Sun Jan 18 1998  Martin Stjernholm  <cc-mode-help@python.org>
 
 	* cc-cmds.el (c-beginning-of-statement): Handle multiple C++ line
- 	comments a little better.
+	comments a little better.
 
 	Almost completely rewritten.  It's now more thorough when handling
- 	strings and comments and the transitions between them and the
- 	surrounding code.  The statement parsing is also rewritten because
- 	`c-{beginning|end}-of-statement-1' does no longer do what we want
- 	in this function (e.g. c-b-o-s-1 doesn't go into blocks).  It also
- 	works better for different counts and when sentence-flag is nil.
+	strings and comments and the transitions between them and the
+	surrounding code.  The statement parsing is also rewritten because
+	`c-{beginning|end}-of-statement-1' does no longer do what we want
+	in this function (e.g. c-b-o-s-1 doesn't go into blocks).  It also
+	works better for different counts and when sentence-flag is nil.
 
 	* cc-engine.el (c-forward-syntactic-ws, c-backward-syntactic-ws):
- 	Removed the narrowings which doesn't seem to have much effect.
-  	Instead a simple check is made against the given limit.  In
- 	`c-backward-syntactic-ws' this means that there's no need to
- 	search for bod, which helps up speed quite a lot in some areas.
+	Removed the narrowings which doesn't seem to have much effect.
+	Instead a simple check is made against the given limit.  In
+	`c-backward-syntactic-ws' this means that there's no need to
+	search for bod, which helps up speed quite a lot in some areas.
 
 	(c-collect-line-comments): New function that given the limits of
- 	one C++ style line comment returns the range for all adjacent line
- 	comments.  This functionality is moved from the functions
- 	`c-literal-limits' and `c-literal-limits-fast'.
+	one C++ style line comment returns the range for all adjacent line
+	comments.  This functionality is moved from the functions
+	`c-literal-limits' and `c-literal-limits-fast'.
 
 	(c-literal-limits): New function that finds the start and end pos
- 	of a comment or string surrounding point.  This function is Emacs
- 	19.34 compatible and it has a workaround for what seems to be a
- 	bug in `parse-partial-sexp' when we use an existing state to get
- 	the state for the very next character.
+	of a comment or string surrounding point.  This function is Emacs
+	19.34 compatible and it has a workaround for what seems to be a
+	bug in `parse-partial-sexp' when we use an existing state to get
+	the state for the very next character.
 
 	(c-literal-limits-fast): A faster variant of `c-literal-limits'
- 	for newer Emacsen where the state returned from
- 	`parse-partial-sexp' contains the starting pos of the last
- 	literal.  This does not contain the workaround described above.
-  	The function is not yet tested and therefore not in use for now.
-  	Note that these functions regard the position between the first
- 	and second char of a comment starter to be part of the comment.
-  	Although `parse-partial-sexp' (in Emacs 19 anyway) doesn't do
- 	this, it seems more intuitive to me.  Maybe `c-in-literal' should
- 	do this too?
+	for newer Emacsen where the state returned from
+	`parse-partial-sexp' contains the starting pos of the last
+	literal.  This does not contain the workaround described above.
+	The function is not yet tested and therefore not in use for now.
+	Note that these functions regard the position between the first
+	and second char of a comment starter to be part of the comment.
+	Although `parse-partial-sexp' (in Emacs 19 anyway) doesn't do
+	this, it seems more intuitive to me.  Maybe `c-in-literal' should
+	do this too?
 
 Thu Jan 15 1998  Martin Stjernholm  <cc-mode-help@python.org>
 
-	* cc-mode-19.el Added `when' and `unless'. 
+	* cc-mode-19.el Added `when' and `unless'.
 
 Thu Jan 15 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-engine.el (c-guess-basic-syntax): Fixed a few byte compiler
- 	warnings.
+	warnings.
 
 Wed Jan 14 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-cmds.el (c-beginning-of-defun, c-end-of-defun): New commands
- 	which mimic the standard built-ins, but do a much better job of
- 	finding the open brace when it's hung on the right side (as is the
- 	case with the most common Java style).
+	which mimic the standard built-ins, but do a much better job of
+	finding the open brace when it's hung on the right side (as is the
+	case with the most common Java style).
 
 	* cc-engine.el (c-backward-to-start-of-do): Break infloop for
- 	illegal code, e.g. when someone types while (TRUE) { at the top of
- 	a buffer, we shouldn't hang when the { is typed!
+	illegal code, e.g. when someone types while (TRUE) { at the top of
+	a buffer, we shouldn't hang when the { is typed!
 
 Tue Jan 13 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-cmds.el (c-beginning-of-statement): When moving forward by
- 	sentences, because we're either inside or at the start of a
- 	comment, be sure to limit movement to only within the extent of
- 	the comment.
+	sentences, because we're either inside or at the start of a
+	comment, be sure to limit movement to only within the extent of
+	the comment.
 
 Sat Jan 10 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-langs.el (c-java-method-key): I really don't remember why
- 	this was added, but it seems to do more harm than good.  Besides,
- 	its value was clearly wrong, being inherited from Objective-C.
+	this was added, but it seems to do more harm than good.  Besides,
+	its value was clearly wrong, being inherited from Objective-C.
 
 	* cc-mode.el (java-mode): Set c-method-key to nil.  I don't think
- 	this is necessary for Java, and besides, the old value was
- 	inherited from Objective-C which was clearly not right.  With this
- 	change, all regression tests pass and the example by Bengt
- 	Martensson also passes:
+	this is necessary for Java, and besides, the old value was
+	inherited from Objective-C which was clearly not right.  With this
+	change, all regression tests pass and the example by Bengt
+	Martensson also passes:
 
 	class Baz
 	{
 	}
 
 	* cc-mode.texi Add some explanation to "gnu" style and "user"
- 	style, describing the relationship between these and user
- 	Customizations.
+	style, describing the relationship between these and user
+	Customizations.
 
 	* cc-vars.el (c-default-style): Change this back to "gnu" after
- 	(re-reading old) discussions with RMS.  This may confuse users who
- 	set variables in the top-level of their .emacs files, or using the
- 	Custom interface, since those changes will get incorporated into
- 	the "user" style.  RMS insists, however, that the default style be
- 	"gnu".
+	(re-reading old) discussions with RMS.  This may confuse users who
+	set variables in the top-level of their .emacs files, or using the
+	Custom interface, since those changes will get incorporated into
+	the "user" style.  RMS insists, however, that the default style be
+	"gnu".
 
 Sun Jan 04 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-cmds.el (c-electric-colon): Newlines should not be inserted
- 	before or after scope operators, regardless of the value of
- 	c-hanging-colons.
+	before or after scope operators, regardless of the value of
+	c-hanging-colons.
 
 	* cc-engine.el (c-backward-to-start-of-if): Workaround a nasty to
- 	track down bug.  If point is < lim, then this function can
- 	actually land you forward into the buffer.  This can cause an
- 	infloop in c-beginning-of-statement-1. It is probably a bug that
- 	this function gets called with a lim > point, but that's even
- 	harder to figure out, so if that's the case when this function is
- 	called, it's simpler just to ignore lim and use bod.  This breaks
- 	the infloop without causing broken indentation.
+	track down bug.  If point is < lim, then this function can
+	actually land you forward into the buffer.  This can cause an
+	infloop in c-beginning-of-statement-1. It is probably a bug that
+	this function gets called with a lim > point, but that's even
+	harder to figure out, so if that's the case when this function is
+	called, it's simpler just to ignore lim and use bod.  This breaks
+	the infloop without causing broken indentation.
 
 Sat Jan 03 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-align.el (c-lineup-dont-change): New lineup function that
- 	leaves the current line's indentation unchanged.  Used for the new
- 	cpp-macro-cont syntactic symbol.
+	leaves the current line's indentation unchanged.  Used for the new
+	cpp-macro-cont syntactic symbol.
 
 	* cc-cmds.el (c-electric-brace): namespace-open and
- 	namespace-close braces can hang.
+	namespace-close braces can hang.
 
 	* cc-defs.el (c-emacs-features): Added autoload cookie which Steve
- 	Baur claims is necessary for XEmacs.
+	Baur claims is necessary for XEmacs.
 
 	* cc-engine.el (c-search-uplist-for-classkey): When searching up
- 	for a class key, instead of hardcoding the extended search for
- 	"extern", use the new variable c-extra-toplevel-key, which is
- 	language dependent.  For C++, this variable includes the keyword
- 	"namespace" which will match C++ namespace introducing blocks.
-	
-  	(c-guess-basic-syntax): Support for recognizing C++ namespace
- 	blocks, by elaborating on the mechanism used to find external
- 	language blocks.  Searches which hardcoded "extern" now use
- 	c-extra-toplevel-key, a language dependent variable.  Case clauses
- 	that were modified: CASE 5A.1, CASE 5A.4, CASE 5F, CASE 5I, CASE
- 	14A.
+	for a class key, instead of hardcoding the extended search for
+	"extern", use the new variable c-extra-toplevel-key, which is
+	language dependent.  For C++, this variable includes the keyword
+	"namespace" which will match C++ namespace introducing blocks.
 
-  	CASE 3: we can now determine whether we're at the beginning of a
- 	cpp macro definition, or inside the middle of one. Set syntax to
- 	'cpp-macro in the former case, 'cpp-macro-cont in the latter.  In
- 	both cases, the relpos is the beginning of the macro.
+	(c-guess-basic-syntax): Support for recognizing C++ namespace
+	blocks, by elaborating on the mechanism used to find external
+	language blocks.  Searches which hardcoded "extern" now use
+	c-extra-toplevel-key, a language dependent variable.  Case clauses
+	that were modified: CASE 5A.1, CASE 5A.4, CASE 5F, CASE 5I, CASE
+	14A.
+
+	CASE 3: we can now determine whether we're at the beginning of a
+	cpp macro definition, or inside the middle of one. Set syntax to
+	'cpp-macro in the former case, 'cpp-macro-cont in the latter.  In
+	both cases, the relpos is the beginning of the macro.
 
 	(c-forward-syntactic-ws): Added code that skips forward over
- 	multi-line cpp macros.
+	multi-line cpp macros.
 
 	(c-beginning-of-macro): Moved, and made into a defsubst.  This
- 	function can now actually find the beginning of a multi-line C
- 	preprocessor macro.
-	
-  	(c-backward-syntactic-ws): Use c-beginning-of-macro to skip
- 	backwards over multi-line macro definitions.
+	function can now actually find the beginning of a multi-line C
+	preprocessor macro.
+
+	(c-backward-syntactic-ws): Use c-beginning-of-macro to skip
+	backwards over multi-line macro definitions.
 
 	(c-in-literal, c-fast-in-literal): Use c-beginning-of-macro to
- 	find out whether we're in a multi-line macro definition.
-	
+	find out whether we're in a multi-line macro definition.
+
 	* cc-langs.el (c-C-extra-toplevel-key, c-C++-extra-toplevel-key,
- 	c-extra-toplevel-key): New variables which parameterize the search
- 	for additional top-level enclosing constructs.  In all languages,
- 	extern lang blocks are supported (but maybe this should just be C
- 	and C++?). In C++, also namespace blocks are supported.
+	c-extra-toplevel-key): New variables which parameterize the search
+	for additional top-level enclosing constructs.  In all languages,
+	extern lang blocks are supported (but maybe this should just be C
+	and C++?). In C++, also namespace blocks are supported.
 
-	* cc-menus.el Imenu patches by Masatake Yamato and Jan Dubois. 
+	* cc-menus.el Imenu patches by Masatake Yamato and Jan Dubois.
 
 	* cc-mode.el (c++-mode): Set c-extra-toplevel-key to
- 	c-C++-extra-toplevel-key.
+	c-C++-extra-toplevel-key.
 
 	(c-initialize-on-load): New variable, *not* customized.  When set
- 	to t -- the default -- c-initialize-cc-mode is called when the
- 	cc-mode.el file is loaded, e.g. via (require 'cc-mode).  This is
- 	backwards compatible with .emacs files that used CC Mode 4.  I'm
- 	still not 100% sure this is the right thing to do.
+	to t -- the default -- c-initialize-cc-mode is called when the
+	cc-mode.el file is loaded, e.g. via (require 'cc-mode).  This is
+	backwards compatible with .emacs files that used CC Mode 4.  I'm
+	still not 100% sure this is the right thing to do.
 
 	* cc-mode.texi: Added descriptions of the new C++ namespace
- 	syntactic symbols: namespace-open, namespace-close, innamespace.
-  	Added an example for this and also multi-line macros.
+	syntactic symbols: namespace-open, namespace-close, innamespace.
+	Added an example for this and also multi-line macros.
 
 	Describe c-lineup-dont-change and the new cpp-macro-cont syntactic
- 	symbol.  Remove the `known limitation' that multi-line macros
- 	aren't supported.
+	symbol.  Remove the `known limitation' that multi-line macros
+	aren't supported.
 
 	* cc-styles.el (c-offsets-alist): Three new syntactic symbols:
- 	innamespace, namespace-open, namespace-close.  These support C++
- 	namespace blocks.
+	innamespace, namespace-open, namespace-close.  These support C++
+	namespace blocks.
 
 	Added new syntactic symbol cpp-macro-cont, by default bound to
- 	c-lineup-dont-change.  This symbol is assigned to subsequent lines
- 	of a multi-line C preprocess macro definition.
+	c-lineup-dont-change.  This symbol is assigned to subsequent lines
+	of a multi-line C preprocess macro definition.
 
 	* cc-vars.el (c-default-style): Variable is user customizable so
- 	it's docstring should start with a `*'.
+	it's docstring should start with a `*'.
 
 Fri Jan 02 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-engine.el (c-fast-in-literal): Function which should be
- 	faster than c-in-literal.  This uses buffer-syntactic-context
- 	which is a speedy built-in that exists only in XEmacs.  Make it's
- 	alias conditional on that built-in's existance.  To be honest, the
- 	performance effects should be tested.  Also c-fast-in-literal
- 	knows about multi-line cpp macros while c-in-literal does not.
-  	The latter should be taught about this, but this change will wait
- 	for a future mega-patch to handle multi-line macros.
+	faster than c-in-literal.  This uses buffer-syntactic-context
+	which is a speedy built-in that exists only in XEmacs.  Make it's
+	alias conditional on that built-in's existance.  To be honest, the
+	performance effects should be tested.  Also c-fast-in-literal
+	knows about multi-line cpp macros while c-in-literal does not.
+	The latter should be taught about this, but this change will wait
+	for a future mega-patch to handle multi-line macros.
 
 Thu Jan 01 1998  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-cmds.el (c-comment-line-break-function): When breaking a
- 	line-oriented comment, copy the comment leader from the previous
- 	line instead of hardcoding it to "// ".  This ensures that
- 	whitespace between the slashes and the text is preserved.
+	line-oriented comment, copy the comment leader from the previous
+	line instead of hardcoding it to "// ".  This ensures that
+	whitespace between the slashes and the text is preserved.
 
 Tue Nov 18 1997  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-langs.el (c-mode-base-map): Bind c-mark-function using a
- 	portable representation of C-M-h that differentiates this from
- 	M-BS on both XEmacs and Emacs.
+	portable representation of C-M-h that differentiates this from
+	M-BS on both XEmacs and Emacs.
 
 Sat Nov 15 1997  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-cmds.el (c-electric-pound, c-electric-brace,
- 	c-electric-slash, c-electric-star, c-electric-semi&comma,
- 	c-electric-colon, c-electric-lt-gt, c-scope-operator,
- 	c-indent-command, c-indent-exp, c-indent-defun,
- 	c-backslash-region, c-fill-paragraph): Added "*" to interactive
- 	spec to barf-if-buffer-read-only.
+	c-electric-slash, c-electric-star, c-electric-semi&comma,
+	c-electric-colon, c-electric-lt-gt, c-scope-operator,
+	c-indent-command, c-indent-exp, c-indent-defun,
+	c-backslash-region, c-fill-paragraph): Added "*" to interactive
+	spec to barf-if-buffer-read-only.
 
 Fri Nov 14 1997  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-cmds.el (c-fill-paragraph): regexp-quote the fill-prefix when
- 	search forward for the end of line oriented comments.  This is in
- 	case the fill-prefix contains regexp special characters
- 	(e.g. fill-prefix == " //* ")
+	search forward for the end of line oriented comments.  This is in
+	case the fill-prefix contains regexp special characters
+	(e.g. fill-prefix == " //* ")
 
-	(c-backslash-region): Do not preserve the zmacs region (XEmacs). 
+	(c-backslash-region): Do not preserve the zmacs region (XEmacs).
 
 Wed Nov 12 1997  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-langs.el (c-mode-base-map): c-mark-function moved back to
- 	M-C-h.  RMS says: "It ought to be on M-C-h, because that is the
- 	key to mark one function definition in whatever language you're
- 	using."  I don't remember why it was moved in the first place.
+	M-C-h.  RMS says: "It ought to be on M-C-h, because that is the
+	key to mark one function definition in whatever language you're
+	using."  I don't remember why it was moved in the first place.
 
 Tue Nov 04 1997  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-cmds.el (c-electric-backspace, c-electric-delete):
- 	Interactive spec should have a read-only *.
+	Interactive spec should have a read-only *.
 
 Thu Oct 30 1997  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-styles.el (c-styles-alist): Merged "jdk" into "java" style
- 	and removed "jdk" style.  Only differences now are inline-open and
- 	c-basic-offset.
+	and removed "jdk" style.  Only differences now are inline-open and
+	c-basic-offset.
 
 Wed Oct 29 1997  Barry Warsaw  <cc-mode-help@python.org>
 
-	* cc-mode.texi Document "jdk" style. 
+	* cc-mode.texi Document "jdk" style.
 
 	* cc-styles.el (c-style-alist): "jdk" style given by Martin
- 	Buchholz <mrb@Eng.Sun.COM> for conformance with Sun's JDK style.
+	Buchholz <mrb@Eng.Sun.COM> for conformance with Sun's JDK style.
 
 Fri Oct 10 1997  Barry Warsaw  <cc-mode-help@python.org>
 
 	* cc-styles.el (c-set-style-2, c-initialize-builtin-style): Don't
- 	special case "cc-mode", it's a derived style.
+	special case "cc-mode", it's a derived style.
 
 	Fix setup of derived style "cc-mode".
 
 	Introduce the new default style "user" which contains all user
- 	customizations.  The style "cc-mode" is retained as an alias, but
- 	it's use is deprecated.  The default style variable has been
- 	renamed c-default-style.
+	customizations.  The style "cc-mode" is retained as an alias, but
+	it's use is deprecated.  The default style variable has been
+	renamed c-default-style.
 
 	* cc-vars.el (c-site-default-style): Renamed to c-default-style.
-  	Also, the default value is now "user".
-	
+	Also, the default value is now "user".
+
 1998-01-24  SL Baur  <steve@altair.xemacs.org>
 
 	* Makefile (VERSION): Update to package standard 1.0.
 1997-12-21  SL Baur  <steve@altair.xemacs.org>
 
 	* Makefile: Created.
-
-Manifest for CC Mode 5.25
-Barry A. Warsaw and Martin Stjernholm
+Manifest for CC Mode 5.27
+Martin Stjernholm
 <mailto:bug-cc-mode@gnu.org>
 
 You should have received the following files in this distribution:
+CC Mode NEWS -- user visible changes.  -*- outline -*-
+
+* Changes in 5.27
+
+Note: This is mostly a bugfix release.  The features labeled
+experimental in 5.26 remains and are now considered permanent.
+
+** c-style-variables-are-local-p now defaults to t.
+This is an incompatible change that has been made to make the behavior
+of the style system wrt global variable settings less confusing for
+non-advanced users.  If you know what this variable does you might
+want to set it to nil in your .emacs, otherwise you probably don't
+have to bother.
+
+Defaulting c-style-variables-are-local-p to t avoids the confusing
+situation that occurs when a user sets some style variables globally
+and edit both a Java and a non-Java file in the same Emacs session.
+If the style variables aren't buffer local in this case, loading of
+the second file will cause the default style (either "gnu" or "java"
+by default) to override the global settings made by the user.
+
+* Changes in 5.26
+
+Note: This release contains changes that might not be compatible with
+current user setups (although it's believed that these
+incompatibilities will only show in very uncommon circumstances).
+However, since the impact is uncertain, these changes may be rolled
+back depending on user feedback.  Therefore there's no forward
+compatibility guarantee wrt the new features introduced in this
+release.
+
+** New initialization procedure for the style system.
+When the initial style for a buffer is determined by CC Mode (from the
+variable c-default-style), the global values of style variables now
+take precedence over the values specified by the chosen style.  This
+is different than the old behavior: previously, the style-specific
+settings would override the global settings.  This change makes it
+possible to do simple configuration in the intuitive way with
+Customize or with setq lines in one's .emacs file.
+
+By default, the global value of every style variable is the new
+special symbol set-from-style, which causes the value to be taken from
+the style system.  This means that in effect, only an explicit setting
+of a style variable will cause the "overriding" behavior described
+above.
+
+Also note that global settings override style-specific settings *only*
+when the initial style of a buffer is chosen by a CC Mode major mode
+function.  When a style is chosen in other ways --- for example, by a
+call like (c-set-style "gnu") in a hook, or via M-x c-set-style ---
+then the style-specific values take precedence over any global style
+values.  In Lisp terms, global values override style-specific values
+only when the new second argument to c-set-style is non-nil; see the
+function documentation for more info.
+
+The purpose of these changes is to make it easier for users,
+especially novice users, to do simple customizations with Customize or
+with setq in their .emacs files.  On the other hand, the new system is
+intended to be compatible with advanced users' customizations as well,
+such as those that choose styles in hooks or whatnot.  This new system
+is believed to be almost entirely compatible with current
+configurations, in spite of the changed precedence between style and
+global variable settings when a buffer's default style is set.
+
+(Thanks to Eric Eide for clarifying this explanation a bit.)
+
+*** c-offsets-alist is now a customizable variable.
+This became possible as a result of the new initialization behavior.
+
+This variable is treated slightly differently from the other style
+variables; instead of using the symbol set-from-style, it will be
+completed with the syntactic symbols it doesn't already contain when
+the style is first initialized.  This means it now defaults to the
+empty list to make all syntactic elements get their values from the
+style system.
+
+*** Compatibility variable to restore the old behavior.
+In case your configuration doesn't work with this change, you can set
+c-old-style-variable-behavior to non-nil to get the old behavior back
+as far as possible.
+
+** Improvements to line breaking and text filling.
+CC Mode now handles this more intelligently and seamlessly wrt the
+surrounding code, especially inside comments.  For details see the new
+chapter about this in the manual.
+
+*** New variable to recognize comment line prefix decorations.
+The variable c-comment-prefix-regexp has been added to properly
+recognize the line prefix in both block and line comments.  It's
+primarily used to initialize the various paragraph recognition and
+adaptive filling variables that the text handling functions uses.
+
+*** New variable c-block-comment-prefix.
+This is a generalization of the now obsolete variable
+c-comment-continuation-stars to handle arbitrary strings.
+
+*** CC Mode now uses adaptive fill mode.
+This to make it adapt better to the paragraph style inside comments.
+
+It's also possible to use other adaptive filling packages inside CC
+Mode, notably Kyle E. Jones' Filladapt mode (http://wonderworks.com/).
+A new convenience function c-setup-filladapt sets up Filladapt for use
+inside CC Mode.
+
+Note though that the 2.12 version of Filladapt lacks a feature that
+causes it to work suboptimally when c-comment-prefix-regexp can match
+the empty string (which it commonly does).  A patch for that is
+available from the CC Mode web site (http://www.python.org/emacs/
+cc-mode/).
+
+*** It's now possible to selectively turn off auto filling.
+The variable c-ignore-auto-fill is used to ignore auto fill mode in
+specific contexts, e.g. in preprocessor directives and in string
+literals.
+
+*** New context sensitive line break function c-context-line-break.
+It works like newline-and-indent in normal code, and adapts the line
+prefix according to the comment style when used inside comments.  If
+you're normally using newline-and-indent, you might want to switch to
+this function.
+
+** Fixes to IDL mode.
+It now does a better job in recognizing only the constructs relevant
+to IDL.  E.g. it no longer matches "class" as the beginning of a
+struct block, but it does match the CORBA 2.3 "valuetype" keyword.
+Thanks to Eric Eide.
+
+** Improvements to the Whitesmith style.
+It now keeps the style consistently on all levels and both when
+opening braces hangs and when they don't.
+
+*** New lineup function c-lineup-whitesmith-in-block.
+
+** New lineup functions c-lineup-template-args and c-indent-multi-line-block.
+See their docstrings for details.  c-lineup-template-args does a
+better job of tracking the brackets used as parens in C++ templates,
+and is used by default to line up continued template arguments.
+
+** c-lineup-comment now preserves alignment with a comment on the
+previous line.  It used to instead preserve comments that started in
+the column specified by comment-column.
+
+** c-lineup-C-comments handles "free form" text comments.
+In comments with a long delimiter line at the start, the indentation
+is kept unchanged for lines that start with an empty comment line
+prefix.  This is intended for the type of large block comments that
+contain documentation with its own formatting.  In these you normally
+don't want CC Mode to change the indentation.
+
+** The `c' syntactic symbol is now relative to the comment start
+instead of the previous line, to make integers usable as lineup
+arguments.
+
+** All lineup functions have gotten docstrings.
+
+** More preprocessor directive movement functions.
+c-down-conditional does the reverse of c-up-conditional.
+c-up-conditional-with-else and c-down-conditional-with-else are
+variants of these that also stops at "#else" lines (suggested by Don
+Provan).
+
+** Minor improvements to many movement functions in tricky situations.
+
+* Changes in 5.25
+
+This is a bug fix release only.
+
+* Changes in 5.24
+
+Note: See also changes in 5.23 to get the complete list of additions
+since the last public release.
+
+** c-default-style can now take an association list that maps major
+modes to style names.  When this variable is an alist, Java mode no
+longer hardcodes a setting to "java" style.  See the variable's
+docstring for details.
+
+** It's now possible to put a list as the offset on a syntactic
+symbol.  The list is evaluated recursively until a non-nil offset is
+found.  This is useful to combine several lineup functions to act in a
+prioritized order on a single line.  However, none of the supplied
+lineup functions use this feature currently.
+
+** New syntactic symbol catch-clause, which is used on the "catch" and
+"finally" lines in try-catch constructs in C++ and Java.
+
+** New cleanup brace-catch-brace on c-cleanup-list, which does for
+"catch" lines what brace-elseif-brace does for "else if" lines.
+
+** The braces of Java anonymous inner classes are treated separately
+from the braces of other classes in auto-newline mode.  Two new
+symbols inexpr-class-open and inexpr-class-close may be used on
+c-hanging-braces-alist to control the automatic newlines used for
+anonymous classes.
+
+** bug-cc-mode@gnu.org is now the primary bug reporting address.
+This is an alias for cc-mode-help@python.org.
+
+* Changes in 5.23
+
+Note: Due to the extensive changes, this version was a beta test
+release that was never publically announced.
+
+** Support for the Pike language added, along with new Pike specific
+syntactic symbols: inlambda, lambda-intro-cont
+
+** Support for Java anonymous classes via new syntactic symbol
+inexpr-class.  New syntactic symbol inexpr-statement for Pike
+support and gcc-style statements inside expressions.  New lineup
+function c-lineup-inexpr-stat.
+
+** New syntactic symbol brace-entry-open which is used in brace lists
+(i.e. static initializers) when a list entry starts with an open
+brace.  These used to be recognized as brace-list-entry's.
+c-electric-brace also recognizes brace-entry-open braces
+(brace-list-entry's can no longer be electrified).
+
+** New command c-indent-line-or-region, not bound by default.
+
+** Improvements to M-C-h (c-mark-function).
+
+** `#' is only electric when typed in the indentation of a line.
+
+** Parentheses are now electric (via the new command c-electric-paren)
+for auto-reindenting lines when parens are typed.
+
+** In "gnu" style, inline-open offset is now set to zero.
+
+** Uniform handling of the inclass syntactic symbol.  The indentation
+associated with it is now always relative to the class opening brace.
+This means that the indentation behavior has changed in some
+circumstances, but only if you've put anything besides 0 on the
+class-open syntactic symbol (none of the default styles do that).
+
+** c-enable-xemacs-performance-kludge-p is set to nil by default,
+since for Emacs-friendly styles (i.e. where the top-level opening
+brace starts in column zero) setting this variable to t can degrade
+performance significantly.
+
+* Changes in 5.22
+
+Note: There was no net release of 5.22!  This version went only to the
+XEmacs developers and was primarily a bug fix release.
+
+* Changes in 5.21
+
+This is a bug fix release only.
+
+* Changes in 5.20
+
+** Multiline macros are now handled, both as they affect indentation,
+and as recognized syntax.  New syntactic symbol cpp-macro-cont is
+assigned to second and subsequent lines of a multiline macro
+definition.
+
+** A new style "user" which captures all non-hook-ified
+(i.e. top-level) .emacs file variable setings and customizations.
+Style "cc-mode" is an alias for "user" and is deprecated.  "gnu" style
+is still the default however.
+
+** "java" style now conforms to Sun's JDK coding style.
+
+** New commands c-beginning-of-defun, c-end-of-defun which are not
+bound by default to C-M-a and C-M-e.
+
+** New and improved implementations of M-a (c-beginning-of-statement)
+and M-e (c-end-of-statement).
+
+** C++ namespace blocks are supported, with new syntactic symbols
+namespace-open, namespace-close, and innamespace.
+
+** File local variable settings of c-file-style and c-file-offsets
+makes the style variables local to that buffer only.
+
+** New indentation functions c-lineup-close-paren,
+c-indent-one-line-block, c-lineup-dont-change.
+
+** Various Imenu patches (thanks to Masatake Yamato, Jan Dubois, and
+Peter Pilgrim).
+
+** Performance improvements.  Some improvements affect only Emacs or
+only XEmacs (see the variable c-enable-xemacs-performance-kludge-p).
+
+** Improvements (hopefully!) to the way CC Mode is loaded.  You should
+now be able to do a (require 'cc-mode) to get the entire package
+loaded properly for customization in your .emacs file.  A new variable
+c-initialize-on-load controls this and is set to t by default.
+
+* Changes in 5.19
+
+** extern-lang-close relative buffer positions have changed.  The used
+to point to the extern's open brace, but they now point to the first
+non-whitespace character on the line with the open brace.
+
+** c-progress-interval's semantics have changed slightly.  When set to
+nil, indentation proceeds silently.  Previously, even when nil, the
+start and end messages were printed.
+
+* Changes in 5.18
+
+** M-a and M-e should now properly move into comments when point is
+before or after a comment, and move by sentences when inside a
+comment.
+
+** c-electric-slash should be bound in all modes now.  Also,
+c-expand-macro is not bound in Java or IDL modes.
+
+** Imenu enhancements: Objective-C support donated by Masatake (jet)
+YAMATO; a fix to Java support given by Ake Stenhoff; and improvements
+to C++ support given by Jan Dubois.
+
+* Changes in 5.17
+
+** Recognition of enum declarations in K&R argdecls.
+
+** Changes to "python" style to more closely match Python C API coding
+standards.
+
+** / is bound to c-electric-slash in all modes, and C-c C-e is bound
+to c-expand-macro in all languages except Java and IDL.
+
+* Changes in 5.16
+
+This is primarily a bug fix release.  Users of XEmacs 19.15 and Emacs
+19.34 are highly encouraged to pick up this release.
+
+* Changes in 5.15
+
+** A new syntactic symbol: template-args-cont, used in C++ template
+declarations where the argument list spans multiple lines.
+
+** In "java" style, c-hanging-comment-starter-p defaults to nil to
+preserve Javadoc starter lines.
+
+** Line oriented comments (i.e. C++ style comments) are now recognized
+by default in all modes, including C mode (as per the ANSI 9X C draft
+standard).  Thus the function c-enable-//-in-c-mode has been removed.
+
+** Auto-filling of comments has been improved.  CC Mode will now
+properly auto-fill both line and block oriented comments, and allows
+you to choose the leader string on block oriented continued comments,
+via the variable c-comment-continuation-stars.  See the CC Mode manual
+for details.
+
+** c-electric-slash is electric in all modes.
+
+** The need for c-mode-19.el is automatically detected now.  You do
+not need to load or require it in your .emacs file.
+
+* Changes in 5.14
+
+** Support for CORBA's IDL language.  There is now a new mode called
+idl-mode, with all the expected hooks, abbreviation tables, etc.
+
+** In "java" style, c-hanging-comment-starter-p is set to nil by
+default to preserve Javadoc comments.
+
+** A new hook variable: c-initialization-hook. This is called only
+once an X/Emacs session, when the CC Mode package is initialized.
+
+* Changes in version 5
+
+CC Mode version 5 was a major upgrade, as evidenced by the change in
+major revision number.  Here is a list of the important user visible
+changes in CC Mode 5.
+
+** CC Mode 5 will not work with Emacs 18, and will only work with the
+latest Emacs and XEmacs releases.
+
+** c-mode-map is no longer the base keymap for all modes.  This was
+incompatible with the way Emacs 19 supports menus, so now
+c-mode-base-map is the base map for all modes (including c-mode-map).
+If you are installing custom keybindings into c-mode-map and expecting
+them to be present in all other modes, this will break.  Put your
+keybindings in c-mode-base-map instead.
+
+** The function c-electric-delete and variable c-delete-function are
+handled differently now, in order to accomodate the separation of the
+BackSpace and Delete keysyms.  CC Mode now binds only the Delete
+keysym to c-electric-delete (which runs c-delete-function), and the
+BackSpace keysym to c-electric-backspace (which runs
+c-backspace-function).  See the CC Mode manual for details.
+
+** The single cc-mode.el file was simply too unwieldy so I have split
+the file up.  See the MANIFEST file for details.
+
+** Also, all user variables have been converted to Per Abrahamsen's
+Custom library, and all support for older Emacsen have been ripped
+out.  See the release notes for details of running CC Mode 5 in your
+version of Emacs.
+
+** All style variables are now global by default.  Specifically, the
+default value for c-style-variables-are-local-p is nil.  The same
+rules apply as before, only reversed: if you want the style variables
+to be buffer local, you should set c-style-variables-are-local-p to t
+before you load CC Mode.
+
+* Changes from 4.322 to 4.353
+
+** Better control over the buffer localness of the indentation variables.
+
+In previous version of cc-mode the variables that control indentation
+were always buffer local.  This was applauded by those who edited
+files in many different styles, but reviled by those who usually edit
+files of only one style.
+
+You can now control whether these variables are buffer local or not,
+by setting the variable c-style-variables-are-local-p.  This variable
+only has effect at the time cc-mode.el is loaded.  If this variable is
+non-nil, then all indentation style related variables will be made
+buffer local.  Otherwise, they will remain global, so that users can
+actually use setq in their top-level .emacs file without having to use
+a mode hook.
+
+Note that once the variables are made buffer local, they cannot be
+made global again; they will remain buffer local for the rest of the
+current Emacs session.  The list of variables that are buffer
+localizable are:
+
+  c-offsets-alist
+  c-basic-offset
+  c-file-style
+  c-file-offsets
+  c-comment-only-line-offset
+  c-cleanup-list
+  c-hanging-braces-alist
+  c-hanging-colons-alist
+  c-hanging-comment-ender-p
+  c-backslash-column
+  c-label-minimum-indentation
+  c-special-indent-hook
+  c-indentation-style
+
+For backwards compatibility, the default value of
+c-style-variables-are-local-p is non-nil, meaning the variables are
+buffer local by default.  This may change in the future.
+
+** New variable c-indentation-style which holds the current style name
+of the buffer.
+
+** Menus are not installed when running in Infodock.
+
+** Improvements to the alignment of C block comments.
+The variable c-block-comments-indent-p has been removed.
+
+I have improved the c-lineup-C-comments function, which is responsible
+for lining up subsequent lines in C block comments.  It should now do
+the Right Thing for most comment styles that use some combination of
+stars at the beginning of comment lines (including zero stars! :-).
+For example, the following styles are aligned correctly by default:
+
+int main()
+{
+    /*
+     *
+     */
+
+    /*
+    **
+    **
+    */
+
+    /**
+     **
+     **
+     **/
+
+    /***
+     ***
+     ***
+     ***
+     ***/
+
+    /**
+    ***
+    ***
+    **/
+}
+
+For this reason, the variable c-block-comments-indent-p has been
+removed.
+
+** New indentation style python.
+The blessed standard for writing Python extension modules in C.
+
+** New c-cleanup-list option: brace-elseif-brace
+
+* Changes from 4.282 to 4.322
+
+** A new style linux has been added.
+
+**The following variables have been removed from the default cc-mode
+style:
+   c-echo-syntactic-information-p
+   c-strict-syntax-p
+   c-tab-always-indent
+   c-inhibit-startup-warnings-p
+
+** External language declaration blocks are now handled properly.
+Three new syntactic symbols have been added:
+
+*** extern-lang-open
+The brace that opens an extern block.  Hangable via
+c-hanging-braces-alist.
+
+*** extern-lang-close
+The brace that closes an extern block.  Hangable via
+c-hanging-braces-alist.
+
+*** inextern-lang
+A modifier (with no relative buffer position) which is added to
+topmost-intro syntax lines that occur within an extern block.  See the
+texinfo manual for details.
+
+** New variable: c-label-minimum-indentation which defines the minimum
+indentation a label can have in gnu style.  This variable has no
+effect in other styles.
+
+** c-special-indent-hook is handled slightly differently when it
+appears in a style definition; the functions in the style defintion
+are appended to the global value of c-special-indent-hook.
+
+** c-style-alist is defconst'd now.
+This should eliminate problems people had with Java mode.
+
+** Lambda expressions (anonymous functions) can now be used as custom
+indentation functions.
+
+** Whitespace is allowed between the protection keyword (public,
+private, protected) and the trailing colon in C++.
+
+** Java mode now recognizes the finally and synchronized keywords.
+
+** New lineup function: c-lineup-arglist-close-under-paren.
+Try setting arglist-close to this function.
+
+** The variable c-recognize-knr-p is deprecated.
+Now by default, c-mode will always recognize K&R argument declarations
+with no performance penalty.  cc-mode has adopted BOCM's approach
+which assumes that argdecls will always be indented at least one
+space, while the function headers they are associated with will not be
+indented at all.  If your programming style differs from this, you may
+have trouble.  You should remove any setting of this variable from
+your cc-mode configurations!
+
+** New variable c-insert-tab-function, normally just inserts a tab
+character when indicated by c-tab-always-indent and indent-tabs-mode.
+You could set this to run tab-to-tab-stop instead.
+
+** C-s C-s (c-show-syntactic-information) now takes an optional
+universal argument, which inserts the analysis into the buffer on the
+current line, as a comment.
+
+** c-mark-function has been moved to C-c C-m.
+
+** In addition, I have made a change to the way braces which are given
+inline-open syntax are handled.
+
+In the following sample:
+
+  1: class Outer
+  2: {
+  3:     void a_function( int a )
+  4:     {
+  5:         do_something( a );
+  6:     }
+  7:     class Inner
+  8:     {
+  9:         void b_function( int b )
+ 10:         {
+ 11:             do_something( b );
+ 12:         }
+ 13:     }
+ 14: }
+
+cc-mode 4.282 would have analyzed line 4 as ((inline-open . 1)), and
+line 10 as ((inline-open . 87)).  So the fact that this brace opened
+an inclass-inline method which should be given extra indentation, was
+implicit in the syntactic symbol.
+
+Some people have argued that the inclass modifier should be added to
+the analysis of such lines.  This release implements this change so
+that line 4 is now analyzed as ((inclass . 1) (inline-open)) and line
+10 as ((inclass . 87) (inline-open)).  The inline-open symbol has no
+relative buffer position so that braces in nested classes would not be
+indented too much.
-README for CC Mode 5.25
-Current maintainers: Barry A. Warsaw and Martin Stjernholm
-Contact address    : bug-cc-mode@gnu.org (or cc-mode-help@python.org)
+README for CC Mode 5.27
+Current maintainer : Martin Stjernholm
+Contact address    : bug-cc-mode@gnu.org
 
 INTRODUCTION
 
-    The canonical Web location for all knowledge CC Mode is:
+    The canonical web location for all knowledge CC Mode is:
 
-	<http://www.python.org/emacs/cc-mode/>
+	<http://cc-mode.sourceforge.net/>
 
     Please read the cc-mode.texi manual for details on using CC Mode.
     This is available on-line from:
 
-        <http://www.python.org/emacs/cc-mode/cc-mode-html/Top.html>
+        <http://cc-mode.sourceforge.net/cc-mode-html/Top.html>
 
-    As of this writing (23-Oct-1998), CC Mode version 5 currently
+    As of this writing (22-Nov-1999), CC Mode version 5 currently
     works out of the box with XEmacs versions 19.15, 19.16, 20.3,
-    20.4, and 21.0, and with Emacs versions 19.34, 20.2, 20.3.
+    20.4, 21.0, 21.1, and 21.2, and with Emacs versions 19.34, 20.2,
+    20.3, and 20.4.
 
 MORE INFORMATION
 
-    NOTE: Since there are now multiple maintainers of CC Mode, you
-    MUST address all correspondence to bug-cc-mode@gnu.org (or
-    cc-mode-help@python.org, is address is being phased out).
-
-    Check out the CC Mode Web site for the latest information,
+    Check out the CC Mode web site for the latest information,
     updates, tips, installation and compatibility notes, etc. on using
     CC Mode.  The installation instructions given below are an excerpt
     of the on-line instructions.  If you have problems installing CC
 MANUALS
 
     Preformatted versions of the manual in DVI, PostScript, and Info,
-    are all available at the CC Mode Web page.
+    are all available at the CC Mode web page.
 
     To build the manual yourself, you will need the latest Texinfo
-    release (as of this writing, Texinfo 3.11).  Specifically, you
-    must make sure that your are using at least version 2.185 of the
-    texinfo.tex file.  To build the Info manual, simply type:
+    release (as of this writing, Texinfo 4.0).  To build the Info
+    manual, simply type:
 
         % makeinfo cc-mode.texi
 
 
     Here is a quick guide for installing CC Mode.  For the latest
     information on installing CC Mode, including compatibility notes
-    for the various flavors of Emacs, please see the CC Mode Web site
+    for the various flavors of Emacs, please see the CC Mode web site
     given above.
 
   Setting load-path
     un-bytecompiled is not supported and may not work at all depending
     on the flavor of X/Emacs you are using.
 
-    You can byte compile CC Mode by doing the following from your
-    shell:
+    To compile CC Mode, do the following from your shell:
 
         % cd /path/to/cc-mode
         % $(EMACS) -batch -no-site-file -q -l cc-make.el cc-*.el
     You can safely ignore any byte compiler warnings; they are due to
     the cross X/Emacsen support.
 
+    Note: It is important that CC Mode is byte compiled in the correct
+    way.  Avoid compiling from inside an X/Emacs session, since that
+    can produce incorrect byte code files that will generate strange
+    errors later during normal use.
+
     Be sure to see the list of compatibility issues (in the CC Mode
-    canonical Web pages -- see above), for special notes about X/Emacs
+    canonical web pages -- see above), for special notes about X/Emacs
     versions and package interactions.
 
     To test that you have things set up correctly, visit a C file and
 ;;; cc-align.el --- custom indentation functions for CC Mode
 
-;; Copyright (C) 1985,87,92,93,94,95,96,97,98 Free Software Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2000 Free Software Foundation, Inc.
 
-;; Authors:    1998 Barry A. Warsaw and Martin Stjernholm
+;; Authors:    2000- Martin Stjernholm
+;;	       1998-1999 Barry A. Warsaw and Martin Stjernholm
 ;;             1992-1997 Barry A. Warsaw
 ;;             1987 Dave Detlefs and Stewart Clamen
 ;;             1985 Richard M. Stallman
 ;; Boston, MA 02111-1307, USA.
 
 (eval-when-compile
-  (require 'cc-defs)
-  (require 'cc-vars)
-  (require 'cc-engine)
-  (require 'cc-langs))
+  (let ((load-path
+	 (if (and (boundp 'byte-compile-current-file)
+		  (stringp byte-compile-current-file))
+	     (cons (file-name-directory byte-compile-current-file)
+		   load-path)
+	   load-path)))
+    (load "cc-defs" nil t)))
+(require 'cc-engine)
 
 
 ;; Standard indentation line-ups
+
 (defun c-lineup-arglist (langelem)
-  ;; lineup the current arglist line with the arglist appearing just
-  ;; after the containing paren which starts the arglist.
+  "Line up the current argument line under the first argument.
+
+Works with: arglist-cont-nonempty."
   (save-excursion
     (let* ((containing-sexp
 	    (save-excursion
 		 (- (current-column) langelem-col))
 	(goto-char containing-sexp)
 	(or (eolp)
-	    (not (memq (char-after) '(?{ ?\( )))
+	    (not (memq (char-after) '(?{ ?\( ?\[)))
 	    (let ((eol (c-point 'eol))
 		  (here (progn
 			  (forward-char 1)
 	))))
 
 (defun c-lineup-arglist-intro-after-paren (langelem)
-  ;; lineup an arglist-intro line to just after the open paren
+  "Line up a line just after the open paren of the surrounding paren or
+brace block.
+
+Works with: defun-block-intro, brace-list-intro,
+statement-block-intro, statement-case-intro, arglist-intro."
   (save-excursion
     (let ((langelem-col (c-langelem-col langelem t))
 	  (ce-curcol (save-excursion
       (- ce-curcol langelem-col -1))))
 
 (defun c-lineup-arglist-close-under-paren (langelem)
-  ;; lineup an arglist-close line under the corresponding open paren
+  "Line up a closing paren line under the corresponding open paren.
+
+Works with: defun-close, class-close, inline-close, block-close,
+brace-list-close, arglist-close, extern-lang-close, namespace-close
+\(for most of these, a zero offset will normally produce the same
+result, though)."
   (save-excursion
     (let ((langelem-col (c-langelem-col langelem t))
 	  (ce-curcol (save-excursion
       (- ce-curcol langelem-col))))
 
 (defun c-lineup-close-paren (langelem)
-  ;; Indents 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:
-  ;;
-  ;; main (int,                main (
-  ;;       char **               int, char **
-  ;;      )            <->     )              <- c-lineup-close-paren
-  ;;
-  ;; Works with any type of paren.
+  "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:
+
+main (int,              main (
+      char **               int, char **
+     )           <->    )                 <- c-lineup-close-paren
+
+Works with: defun-close, class-close, inline-close, block-close,
+brace-list-close, arglist-close, extern-lang-close, namespace-close."
   (save-excursion
     (condition-case nil
 	(let (opencol spec)
 	  (if (eolp)
 	      0
 	    (- opencol (c-langelem-col langelem t))))
-      (error 0))))
+      (error nil))))
 
 (defun c-lineup-streamop (langelem)
-  ;; lineup stream operators
+  "Line up C++ stream operators under each other.
+
+Works with: stream-op."
   (save-excursion
     (let ((langelem-col (c-langelem-col langelem)))
       (re-search-forward "<<\\|>>" (c-point 'eol) 'move)
       (- (current-column) langelem-col))))
 
 (defun c-lineup-multi-inher (langelem)
-  ;; line up multiple inheritance lines
+  "Line up the classes in C++ multiple inheritance clauses and member
+initializers under each other.  E.g:
+
+class Foo:                Foo::Foo (int a, int b):
+    public Cyphr,             Cyphr (a),
+    public Bar       <->      Bar (b)               <- c-lineup-multi-inher
+
+class Foo                 Foo::Foo (int a, int b)
+    : public Cyphr,           : Cyphr (a),
+      public Bar     <->        Bar (b)             <- c-lineup-multi-inher
+
+class Foo                 Foo::Foo (int a, int b)
+    : public Cyphr            : Cyphr (a)
+    , public Bar     <->      , Bar (b)             <- c-lineup-multi-inher
+
+Works with: inher-cont, member-init-cont."
   (save-excursion
-    (let ((eol (c-point 'eol))
-	  (here (point))
-	  (langelem-col (c-langelem-col langelem)))
+    (let* ((eol (c-point 'eol))
+	   (here (point))
+	   (char-after-ip (progn
+			    (skip-chars-forward " \t")
+			    (char-after)))
+	   (langelem-col (c-langelem-col langelem)))
+
+      ;; This kludge is necessary to support both inher-cont and
+      ;; member-init-cont, since they have different anchor positions.
+      (c-backward-syntactic-ws)
+      (when (eq (char-before) ?:)
+	(backward-char)
+	(c-backward-syntactic-ws))
+
       (skip-chars-forward "^:" eol)
-      (skip-chars-forward " \t:" eol)
+      (if (eq char-after-ip ?,)
+	  (skip-chars-forward " \t" eol)
+	(skip-chars-forward " \t:" eol))
       (if (or (eolp)
 	      (looking-at c-comment-start-regexp))
 	  (c-forward-syntactic-ws here))
       )))
 
 (defun c-lineup-java-inher (langelem)
-  ;; line up Java implements and extends continuations
+  "Line up Java implements and extends declarations.
+If class names follows on the same line as the implements/extends
+keyword, they are lined up under each other.  Otherwise, they are
+indented by adding `c-basic-offset' to the column of the keyword.
+E.g:
+
+class Foo             class Foo
+    extends               extends Cyphr,
+        Bar    <->                Bar     <- c-lineup-java-inher
+    <--> c-basic-offset
+
+Works with: inher-cont."
   (save-excursion
     (let ((langelem-col (c-langelem-col langelem)))
       (forward-word 1)
       (if (looking-at "[ \t]*$")
-	  langelem-col
+	  c-basic-offset
 	(c-forward-syntactic-ws)
 	(- (current-column) langelem-col)))))
 
 (defun c-lineup-java-throws (langelem)
-  ;; lineup func-decl-cont's in Java which are continuations of throws
-  ;; declarations.  If `throws' starts the previous line, line up to
-  ;; just after that keyword.  If not, lineup under the previous line.
+  "Line up Java throws declarations.
+If exception names follows on the same line as the throws keyword,
+they are lined up under each other.  Otherwise, they are indented by
+adding `c-basic-offset' to the column of the throws keyword.  The
+throws keyword itself is also indented by `c-basic-offset' from the
+function declaration start if it doesn't hang.  E.g:
+
+int foo()           int foo() throws Cyphr,
+    throws     <->                   Bar,    <- c-lineup-java-throws
+        Bar    <->                   Vlod    <- c-lineup-java-throws
+<--><--> c-basic-offset
+
+Works with: func-decl-cont."
   (save-excursion
-    (let ((iopl (c-point 'iopl))
-	  (langelem-col (c-langelem-col langelem t))
-	  (extra 0))
-      (back-to-indentation)
-      (cond
-       ((looking-at "throws[ \t\n]")
-	(goto-char (cdr langelem))
-	(setq extra c-basic-offset))
-       ((and (goto-char iopl)
-	     (looking-at "throws[ \t\n]"))
-	(forward-word 1)
-	(skip-chars-forward " \t")
-	(if (eolp)
-	    (progn
-	      (back-to-indentation)
-	      (setq extra c-basic-offset))))
-       (t (goto-char iopl)))
-      (+ (- (current-column) langelem-col) extra))))
+    (let* ((lim (1- (c-point 'bol)))
+	   (throws (catch 'done
+		     (goto-char (cdr langelem))
+		     (while (zerop (c-forward-token-1 1 t lim))
+		       (if (looking-at "throws\\>[^_]")
+			   (throw 'done t))))))
+      (if throws
+	  (if (zerop (c-forward-token-1 1 nil (c-point 'eol)))
+	      (- (current-column) (c-langelem-col langelem))
+	    (back-to-indentation)
+	    (+ (- (current-column) (c-langelem-col langelem))
+	       c-basic-offset))
+	c-basic-offset))))
 
 (defun c-indent-one-line-block (langelem)
-  ;; Adds c-basic-offset to the indentation if the line is a one line
-  ;; block, otherwise 0.  E.g:
-  ;;
-  ;; if (n)                     if (n)
-  ;;   {m+=n; n=0;}     <->     {            <- c-indent-one-line-block
-  ;;                              m+=n; n=0;
-  ;;                            }
+  "Indent a one line block `c-basic-offset' extra.
+E.g:
+
+if (n > 0)                 if (n > 0)
+    {m+=n; n=0;}    <->    {               <- c-indent-one-line-block
+<--> c-basic-offset            m+=n; n=0;
+                           }
+
+The block may be surrounded by any kind of parenthesis characters.
+nil is returned if the line doesn't start with a one line block, which
+makes the function usable in list expressions.
+
+Work with: Almost all syntactic symbols, but most useful on *-open."
   (save-excursion
-    (let ((eol (progn (end-of-line) (point))))
-      (beginning-of-line)
-      (skip-chars-forward " \t")
-      (if (and (eq (following-char) ?{)
+    (let ((eol (c-point 'eol)))
+      (back-to-indentation)
+      (if (and (eq (char-syntax (char-after)) ?\()
 	       (c-safe (progn (c-forward-sexp) t))
-	       (<= (point) eol)
-	       (eq (preceding-char) ?}))
+	       (<= (point) eol))
 	  c-basic-offset
-	0))))
+	nil))))
+
+(defun c-indent-multi-line-block (langelem)
+  "Indent a multi line block `c-basic-offset' extra.
+E.g:
+
+int *foo[] = {           int *foo[] = {
+    NULL,                    NULL,
+    {17},         <->            {       <- c-indent-multi-line-block
+                                 17
+                                 }
+                             <--> c-basic-offset
+
+The block may be surrounded by any kind of parenthesis characters.
+nil is returned if the line doesn't start with a multi line block,
+which makes the function usable in list expressions.
+
+Work with: Almost all syntactic symbols, but most useful on *-open."
+  (save-excursion
+    (let ((eol (c-point 'eol)))
+      (back-to-indentation)
+      (if (and (eq (char-syntax (char-after)) ?\()
+	       (or (not (c-safe (progn (c-forward-sexp) t)))
+		   (> (point) eol)))
+	  c-basic-offset
+	nil))))
 
 (defun c-lineup-C-comments (langelem)
-  ;; line up C block comment continuation lines
+  "Line up C block comment continuation lines.
+Various heuristics are used to handle most of the common comment
+styles.  Some examples:
+
+/*          /**         /*         /* text      /*          /**
+ * text      * text       text        text      ** text      ** text
+ */          */         */         */           */           */
+
+/*********************************************************************
+ * text
+ ********************************************************************/
+
+/*********************************************************************
+    Free form text comments:
+ In comments with a long delimiter line at the start, the indentation
+ is kept unchanged for lines that start with an empty comment line
+ prefix.  The delimiter line is whatever matches the
+ `comment-start-skip' regexp.
+*********************************************************************/
+
+The variable `c-comment-prefix-regexp' is used to recognize the
+comment line prefix, e.g. the `*' that usually starts every line
+inside a comment.
+
+Works with: The `c' syntactic symbol."
   (save-excursion
-    (let ((here (point))
-	  (stars (progn (back-to-indentation)
-			(skip-chars-forward "*")))
-	  (langelem-col (c-langelem-col langelem)))
-      (back-to-indentation)
-      (if (not (re-search-forward "/\\([*]+\\)" (c-point 'eol) t))
-	  (progn
-	    (if (not (looking-at "[*]+"))
+    (let* ((here (point))
+	   (prefixlen (progn (back-to-indentation)
+			     (if (looking-at c-comment-prefix-regexp)
+				 (- (match-end 0) (point))
+			       0)))
+	   (starterlen (save-excursion
+			 (goto-char (cdr langelem))
+			 (looking-at comment-start-skip)
+			 (- (save-excursion
+			      (goto-char (match-end 0))
+			      (skip-chars-backward " \t")
+			      (point))
+			    (or (match-end 1) (point))
+			    1)))	; Don't count the first '/'.
+	   (langelem-col (save-excursion (c-langelem-col langelem))))
+      (if (and (> starterlen 10) (zerop prefixlen))
+	  ;; The comment has a long starter and the line doesn't have
+	  ;; a nonempty comment prefix.  Treat it as free form text
+	  ;; and don't change the indentation.
+	  (- (current-column) langelem-col)
+	(forward-line -1)
+	(back-to-indentation)
+	(if (>= (cdr langelem) (point))
+	    ;; On the second line in the comment.
+	    (if (zerop prefixlen)
+		;; No nonempty comment prefix. Align after comment
+		;; starter.
 		(progn
-		  ;; we now have to figure out where this comment begins.
-		  (goto-char here)
-		  (back-to-indentation)
-		  (if (looking-at "[*]+/")
-		      (progn (goto-char (match-end 0))
-			     (forward-comment -1))
+		  (goto-char (match-end 0))
+		  (if (looking-at "\\([ \t]+\\).+$")
+		      ;; Align with the text that hangs after the
+		      ;; comment starter.
+		      (goto-char (match-end 1)))
+		  (- (current-column) langelem-col))
+	      ;; How long is the comment starter?  if greater than the
+	      ;; length of the comment prefix, align left.  if less
+	      ;; than or equal, align right.  this should also pick up
+	      ;; Javadoc style comments.
+	      (if (> starterlen prefixlen)
+		  (progn
 		    (goto-char (cdr langelem))
-		    (back-to-indentation))))
-	    (- (current-column) langelem-col))
-	(if (zerop stars)
-	    (progn
-	      (skip-chars-forward " \t")
-	      (- (current-column) langelem-col))
-	  ;; how many stars on comment opening line?  if greater than
-	  ;; on current line, align left.  if less than or equal,
-	  ;; align right.  this should also pick up Javadoc style
-	  ;; comments.
-	  (if (> (length (match-string 1)) stars)
-	      (progn
-		(back-to-indentation)
-		(- (current-column) -1 langelem-col))
-	    (- (current-column) stars langelem-col))
-	  )))))
+		    (- (current-column) -1 langelem-col))
+		(goto-char (match-end 0))
+		(skip-chars-backward " \t")
+		(- (current-column) prefixlen langelem-col)))
+	  ;; Not on the second line in the comment.  If the previous
+	  ;; line has a nonempty comment prefix, align with it.
+	  ;; Otherwise, align with the previous nonempty line, but
+	  ;; align the comment ender with the starter.
+	  (when (or (not (looking-at c-comment-prefix-regexp))
+		    (eq (match-beginning 0) (match-end 0)))
+	    (goto-char here)
+	    (back-to-indentation)
+	    (if (looking-at (concat "\\(" c-comment-prefix-regexp "\\)\\*/"))
+		(goto-char (cdr langelem))
+	      (while (and (zerop (forward-line -1))
+			  (looking-at "^[ \t]*$")))
+	      (back-to-indentation)
+	      (if (< (point) (cdr langelem))
+		  ;; Align with the comment starter rather than
+		  ;; with the code before it.
+		  (goto-char (cdr langelem)))))
+	  (- (current-column) langelem-col))))))
 
 (defun c-lineup-comment (langelem)
-  ;; support old behavior for comment indentation. we look at
-  ;; c-comment-only-line-offset to decide how to indent comment
-  ;; only-lines
+  "Line up a comment start according to `c-comment-only-line-offset'.
+If the comment is lined up with a comment starter on the previous
+line, that alignment is preserved.
+
+Works with: comment-intro."
   (save-excursion
     (back-to-indentation)
     ;; this highly kludgiforous flag prevents the mapcar over
     ;; c-syntactic-context from entering an infinite loop
-    (let ((recurse-prevention-flag (boundp 'recurse-prevention-flag)))
+    (let ((recurse-prevention-flag (boundp 'recurse-prevention-flag))
+	  (col (current-column)))
       (cond
-       ;; CASE 1: preserve comment-column
        (recurse-prevention-flag 0)
-       ((= (current-column) comment-column)
+       ;; CASE 1: preserve aligned comments
+       ((save-excursion
+	  (and (c-forward-comment -1)
+	       (= col (current-column))))
 	;; we have to subtract out all other indentation
-	(- comment-column (apply '+ (mapcar 'c-get-offset
-					    c-syntactic-context))))
+	(- col (apply '+ (mapcar 'c-get-offset
+				 c-syntactic-context))))
        ;; indent as specified by c-comment-only-line-offset
        ((not (bolp))
 	(or (car-safe c-comment-only-line-offset)
        ))))
 
 (defun c-lineup-runin-statements (langelem)
-  ;; line up statements in coding standards which place the first
-  ;; statement on the same line as the block opening brace.
+  "Line up statements when the first statement is on the same line as
+the block opening brace.  E.g:
+
+int main()
+{ puts (\"Hello world!\");
+  return 0;                 <- c-lineup-runin-statements
+}
+
+If there is no statement after the opening brace to align with, nil is
+returned.  This makes the function usable in list expressions.
+
+Works with: The `statement' syntactic symbol."
   (if (eq (char-after (cdr langelem)) ?{)
       (save-excursion
 	(let ((langelem-col (c-langelem-col langelem)))
 	  (forward-char 1)
 	  (skip-chars-forward " \t")
-	  (- (current-column) langelem-col)))
-    0))
+	  (unless (eolp)
+	    (- (current-column) langelem-col))))))
 
 (defun c-lineup-math (langelem)
-  ;; line up math statement-cont after the equals
+  "Line up the current line after the equal sign on the first line in
+the statement.  If there isn't any, indent with `c-basic-offset'.  If
+the current line contains an equal sign too, try to align it with the
+first one.
+
+Works with: statement-cont."
   (save-excursion
     (let ((equalp (save-excursion
 		    (goto-char (c-point 'boi))
 	(- (current-column) equalp langelem-col))
       )))
 
+(defun c-lineup-template-args (langelem)
+  "Line up template argument lines under the first argument.
+To allow this function to be used in a list expression, nil is
+returned if there's no template argument on the first line.
+
+Works with: template-args-cont."
+  (save-excursion
+    (c-with-syntax-table c++-template-syntax-table
+      (beginning-of-line)
+      (backward-up-list 1)
+      (if (and (eq (char-after) ?<)
+	       (zerop (c-forward-token-1 1 nil (c-point 'eol))))
+	  (- (current-column) (c-langelem-col langelem))))))
+
 (defun c-lineup-ObjC-method-call (langelem)
-  ;; Line up methods args as elisp-mode does with function args: go to
-  ;; the position right after the message receiver, and if you are at
-  ;; (eolp) indent the current line by a constant offset from the
-  ;; opening bracket; otherwise we are looking at the first character
-  ;; of the first method call argument, so lineup the current line
-  ;; with it.
+  "Line up selector args as elisp-mode does with function args:
+Go to the position right after the message receiver, and if you are at
+the end of the line, indent the current line c-basic-offset columns
+from the opening bracket; otherwise you are looking at the first
+character of the first method call argument, so lineup the current
+line with it.
+
+Works with: objc-method-call-cont."
   (save-excursion
     (let* ((extra (save-excursion
 		    (back-to-indentation)
       (- target-col open-bracket-col extra))))
 
 (defun c-lineup-ObjC-method-args (langelem)
-  ;; Line up the colons that separate args. This is done trying to
-  ;; align colons vertically.
+  "Line up the colons that separate args.
+The colon on the current line is aligned with the one on the first
+line.
+
+Works with: objc-method-args-cont."
   (save-excursion
     (let* ((here (c-point 'boi))
 	   (curcol (progn (goto-char here) (current-column)))
 	  c-basic-offset)))))
 
 (defun c-lineup-ObjC-method-args-2 (langelem)
-  ;; Line up the colons that separate args. This is done trying to
-  ;; align the colon on the current line with the previous one.
+  "Line up the colons that separate args.
+The colon on the current line is aligned with the one on the previous
+line.
+
+Works with: objc-method-args-cont."
   (save-excursion
     (let* ((here (c-point 'boi))
 	   (curcol (progn (goto-char here) (current-column)))
 	  c-basic-offset)))))
 
 (defun c-lineup-inexpr-block (langelem)
-  ;; This function lines up the block for the various constructs that
-  ;; uses a block inside an expression.  For constructs matching
-  ;; c-lambda-key and c-inexpr-block-key, indentation to the column of
-  ;; the beginning of the match is added.  For standalone statement
-  ;; blocks, indentation to the column of the opening brace is added.
+  "Line up the block for constructs that use a block inside an expression,
+e.g. anonymous classes in Java and lambda functions in Pike.  The body
+is aligned with the start of the header, e.g. with the \"new\" or
+\"lambda\" keyword.  Returns nil if the block isn't part of such a
+construct.
+
+Works with: inlambda, inexpr-statement, inexpr-class."
   (save-excursion
     (back-to-indentation)
     (let ((res (or (c-looking-at-inexpr-block)
 		   (if (c-safe (backward-up-list 1)
 			       (eq (char-after) ?{))
 		       (c-looking-at-inexpr-block)))))
-      (if (not res)
-	  0
+      (when res
 	(goto-char (cdr res))
 	(- (current-column)
 	   (progn
 	     (back-to-indentation)
 	     (current-column)))))))
 
+(defun c-lineup-whitesmith-in-block (langelem)
+  "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:
+
+something
+    {                something {
+    foo;     <->         foo;     <- c-lineup-whitesmith-in-block
+    }                    }
+                     <--> c-basic-offset
+
+In the first case the indentation is kept unchanged, in the
+second `c-basic-offset' is added.
+
+Works with: defun-close, defun-block-intro, block-close,
+brace-list-close, brace-list-intro, statement-block-intro, inclass,
+inextern-lang, innamespace."
+  (save-excursion
+    (goto-char (cdr langelem))
+    (back-to-indentation)
+    (if (eq (char-syntax (char-after)) ?\()
+	0
+      c-basic-offset)))
+
 (defun c-lineup-dont-change (langelem)
-  ;; Do not change the indentation of the current line
+  "Do not change the indentation of the current line.
+
+Works with: Any syntactic symbol."
   (save-excursion
     (back-to-indentation)
-    (current-column)))
-
+    (- (current-column) (c-langelem-col langelem))))
 
 
 (defun c-snug-do-while (syntax pos)
     (while syntax
       (setq langelem (car (car syntax))
 	    syntax (cdr syntax))
-      ;; don't adjust comment-only lines
-      (cond ((eq langelem 'comment-intro)
+      ;; don't adjust macro or comment-only lines
+      (cond ((memq langelem '(cpp-macro comment-intro))
 	     (setq syntax nil))
 	    ((memq langelem non-top-levels)
 	     (save-excursion
 
 
 ;; Useful for c-hanging-semi&comma-criteria
+
 (defun c-semi&comma-inside-parenlist ()
   "Controls newline insertion after semicolons in parenthesis lists.
 If a comma was inserted, no determination is made.  If a semicolon was
 ;;; cc-cmds.el --- user level commands for CC Mode
 
-;; Copyright (C) 1985,87,92,93,94,95,96,97,98 Free Softare Foundation, Inc.
+;; Copyright (C) 1985,1987,1992-2000 Free Software Foundation, Inc.
 
-;; Authors:    1998 Barry A. Warsaw and Martin Stjernholm
+;; Authors:    2000- Martin Stjernholm
+;;	       1998-1999 Barry A. Warsaw and Martin Stjernholm
 ;;             1992-1997 Barry A. Warsaw
 ;;             1987 Dave Detlefs and Stewart Clamen
 ;;             1985 Richard M. Stallman
 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
+(eval-when-compile
+  (let ((load-path
+	 (if (and (boundp 'byte-compile-current-file)
+		  (stringp byte-compile-current-file))
+	     (cons (file-name-directory byte-compile-current-file)
+		   load-path)
+	   load-path)))
+    (load "cc-defs" nil t)))
+(require 'cc-engine)
 
 
-(eval-when-compile
-  (require 'cc-defs))
-
 (defun c-calculate-state (arg prevstate)
   ;; Calculate the new state of PREVSTATE, t or nil, based on arg. If
   ;; arg is nil or zero, toggle the state. If arg is negative, turn
 after braces based on the value of `c-hanging-braces-alist'.
 
 Also, the line is re-indented unless a numeric ARG is supplied, there
-are non-whitespace characters present on the line after the brace, or
-the brace is inserted inside a literal.
+are non-whitespace characters present on the line after the brace, the
+brace is inserted inside a literal, or `c-syntactic-indentation' is
+nil.
 
 This function does various newline cleanups based on the value of
 `c-cleanup-list'."
 			    (not (bolp)))
 			  (progn (newline)
 				 (setq delete-temp-newline t)))
+		      (if (eq last-command-char ?{)
+			  (setq c-state-cache (cons (point) c-state-cache)))
 		      (self-insert-command (prefix-numeric-value arg))
 		      ;; state cache doesn't change
 		      (c-guess-basic-syntax)))
 						   t))))
 			(setq c-state-cache
 			      (c-hack-state (point) 'open c-state-cache)))))
-		(c-indent-line))
+		(if c-syntactic-indentation
+		    (c-indent-line)))
 	      (setq c-state-cache (c-adjust-state (c-point 'bol) here
 						  (- (point) (c-point 'bol))
 						  c-state-cache))
 		 ;; at least one space.
 		 (delete-indentation)
 		 (just-one-space)
+		 (setq c-state-cache (c-whack-state (point) c-state-cache))
 		 (if (not preserve-p)
 		     (delete-char -1))))
 	  ;; since we're hanging the brace, we need to recalculate
 	  (save-excursion
 	    (let ((bol (c-point 'bol)))
 	      (if (zerop (car (parse-partial-sexp bol (1- (point)))))
-		  (setq c-state-cache (c-whack-state bol c-state-cache)
-			syntax (c-guess-basic-syntax))
+		  (setq syntax (c-guess-basic-syntax))
 		;; gotta punt. this requires some horrible kludgery
 		(beginning-of-line)
 		(makunbound 'c-state-cache)
 	;; Do all appropriate clean ups
 	(let ((here (point))
 	      (pos (- (point-max) (point)))
-	      mbeg mend)
+	      mbeg mend tmp)
 	  ;; clean up empty defun braces
 	  (if (and c-auto-newline
 		   (memq 'empty-defun-braces c-cleanup-list)
 		   ;; make sure matching open brace isn't in a comment
 		   (not (c-in-literal)))
 	      (delete-region (point) (1- here)))
-	  ;; clean up brace-else-brace
-	  (if (and c-auto-newline
-		   (memq 'brace-else-brace c-cleanup-list)
-		   (eq last-command-char ?\{)
+	  ;; clean up brace-else-brace and brace-elseif-brace
+	  (when (and c-auto-newline
+		     (eq last-command-char ?\{)
+		     (not (c-in-literal)))
+	    (cond
+	     ((and (memq 'brace-else-brace c-cleanup-list)
 		   (re-search-backward "}[ \t\n]*else[ \t\n]*{" nil t)
 		   (progn
 		     (setq mbeg (match-beginning 0)
 			   mend (match-end 0))
-		     (= mend here))
-		   (not (c-in-literal)))
-	      (progn
-		(delete-region mbeg mend)
-		(insert "} else {")))
+		     (eq (match-end 0) here)))
+	      (delete-region mbeg mend)
+	      (insert "} else {"))
+	     ((and (memq 'brace-elseif-brace c-cleanup-list)
+		   (progn
+		     (goto-char (1- here))
+		     (setq mend (point))
+		     (skip-chars-backward " \t\n")
+		     (setq mbeg (point))
+		     (eq (char-before) ?\)))
+		   (= (c-backward-token-1 1 t) 0)
+		   (eq (char-after) ?\()
+		   (progn
+		     (setq tmp (point))
+		     (re-search-backward "}[ \t\n]*else[ \t\n]+if[ \t\n]*"
+					 nil t))
+		   (eq (match-end 0) tmp))
+	      (delete-region mbeg mend)
+	      (goto-char mbeg)
+	      (insert " "))))
 	  (goto-char (- (point-max) pos))
 	  )
 	;; does a newline go after the brace?
   2. The slash is part of a `*/' token that closes a block oriented
      comment.
 
-If numeric ARG is supplied or point is inside a literal, indentation
-is inhibited."
+If a numeric ARG is supplied, point is inside a literal, or
+`c-syntactic-indentation' is nil, indentation is inhibited."
   (interactive "*P")
   (let* ((ch (char-before))
-	 (indentp (and (not arg)
+	 (indentp (and c-syntactic-indentation
+		       (not arg)
 		       (eq last-command-char ?/)
 		       (or (and (eq ch ?/)
 				(not (c-in-literal)))
   "Insert a star character.
 If the star is the second character of a C style comment introducing
 construct, and we are on a comment-only-line, indent line as comment.
-If numeric ARG is supplied or point is inside a literal, indentation
-is inhibited."
+If a numeric ARG is supplied, point is inside a literal, or
+`c-syntactic-indentation' is nil, indentation is inhibited."
   (interactive "*P")
   (self-insert-command (prefix-numeric-value arg))
   ;; if we are in a literal, or if arg is given do not re-indent the
   ;; current line, unless this star introduces a comment-only line.
-  (if (and (not arg)
+  (if (and c-syntactic-indentation
+	   (not arg)
 	   (memq (c-in-literal) '(c))
 	   (eq (char-before) ?*)
 	   (save-excursion
 
 When semicolon is inserted, the line is re-indented unless a numeric
 arg is supplied, point is inside a literal, or there are
-non-whitespace characters on the line following the semicolon.
+non-whitespace characters on the line following the semicolon, or
+`c-syntactic-indentation' is nil.
 
 Based on the value of `c-cleanup-list', this function cleans up commas
 following brace lists and semicolons following defuns."
       ;; do all cleanups and newline insertions if c-auto-newline is
       ;; turned on
       (if (not c-auto-newline)
-	  (c-indent-line)
+	  (if c-syntactic-indentation
+	      (c-indent-line))
 	;; clean ups
 	(let ((pos (- (point-max) (point))))
 	  (if (and (or (and
 	      (delete-region (point) here))
 	  (goto-char (- (point-max) pos)))
 	;; re-indent line
-	(c-indent-line)
+	(if c-syntactic-indentation
+	    (c-indent-line))
 	;; check to see if a newline should be added
 	(let ((criteria c-hanging-semi&comma-criteria)
 	      answer add-newline-p)
 after colons based on the value of `c-hanging-colons-alist'.
 
 Also, the line is re-indented unless a numeric ARG is supplied, there
-are non-whitespace characters present on the line after the colon, or
-the colon is inserted inside a literal.
+are non-whitespace characters present on the line after the colon, the
+colon is inserted inside a literal, or `c-syntactic-indentation' is
+nil.
 
 This function cleans up double colon scope operators based on the
 value of `c-cleanup-list'."
 					   (c-guess-basic-syntax)
 					 (delete-char -1)))
 				     c-hanging-colons-alist))))
-      ;; indent the current line
-      (c-indent-line syntax)
+      ;; indent the current line if it's done syntactically.
+      (if c-syntactic-indentation
+	  (c-indent-line syntax))
       ;; does a newline go before the colon?  Watch out for already
       ;; non-hung colons.  However, we don't unhang them because that
       ;; would be a cleanup (and anti-social).
   "Insert a less-than, or greater-than character.
 The line will be re-indented if the character inserted is the second
 of a C++ style stream operator and the buffer is in C++ mode.
-Exceptions are when a numeric argument is supplied, or point is inside
-a literal, in which case the line will not be re-indented."
+Exceptions are when a numeric argument is supplied, point is inside a
+literal, or `c-syntactic-indentation' is nil, in which case the line
+will not be re-indented."
   (interactive "*P")
-  (let ((indentp (and (not arg)
+  (let ((indentp (and c-syntactic-indentation
+		      (not arg)
 		      (eq (char-before) last-command-char)
 		      (not (c-in-literal))))
 	;; shut this up
 appropriate; see the variable `c-cleanup-list'.
 
 Also, the line is re-indented unless a numeric ARG is supplied, there
-are non-whitespace characters present on the line after the colon, or
-the colon is inserted inside a literal."
+are non-whitespace characters present on the line after the
+parenthesis, the parenthesis is inserted inside a literal, or
+`c-syntactic-indentation' is nil."
   (interactive "*P")
   (let (;; shut this up
 	(c-echo-syntactic-information-p nil))
 	     (old-blink-paren blink-paren-function)
 	     blink-paren-function)
 	(self-insert-command (prefix-numeric-value arg))
-	(c-indent-line)
+	(if c-syntactic-indentation
+	    (c-indent-line))
 	(when c-auto-newline
 	  ;; Do all appropriate clean ups
 	  (let ((here (point))
 		  (insert "} catch (")))
 	    (goto-char (- (point-max) pos))
 	    ))
-	(funcall old-blink-paren)))))
+	(if old-blink-paren
+	    (funcall old-blink-paren))))))
 
 
 
 about finding the char with open-parenthesis syntax that starts the
 defun."
   (interactive "p")
+  (unless arg (setq arg 1))
   (if (< arg 0)
       (c-end-of-defun (- arg))
     (while (> arg 0)
 	(cond
 	 (bod (goto-char bod))
 	 (prevbod (goto-char prevbod))
-	 (t (goto-char (c-point 'bod)))))
-      (setq arg (1- arg))))
-  (c-keep-region-active))
+	 (t (goto-char (point-min))
+	    (setq arg 0)))
+	(setq arg (1- arg))))
+    (c-keep-region-active)
+    (= arg 0)))
 
 (defun c-end-of-defun (&optional arg)
   "Move forward to next end of defun.  With argument, do it that many times.
 Negative argument -N means move back to Nth preceding end of defun.
+Returns t unless search stops due to beginning or end of buffer.
 
 An end of a defun occurs right after the close-parenthesis that matches
 the open-parenthesis that starts a defun; see `beginning-of-defun'."
   (if (< arg 0)
       (c-beginning-of-defun (- arg))
     (while (> arg 0)
-      ;; skip down into the next defun-block
-      (while (and (c-safe (down-list 1) t)
-		  (not (eq (char-before) ?{)))
-	(forward-char -1)
-	(c-forward-sexp))
-      (c-beginning-of-defun 1)
-      (c-forward-sexp 1)
-      (setq arg (1- arg)))
-    (forward-line 1))
-  (c-ke