aboutsummaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
authorGerd Moellmann2001-03-21 13:34:57 +0000
committerGerd Moellmann2001-03-21 13:34:57 +0000
commitcb7f2e96771602fb73af13fbbcaec9d0063a3ba5 (patch)
tree223b05770104887e3cd3d547438406f78ccaf447 /man
parentb181014ab53a4bf4c4b4b268210ec8092890aebd (diff)
downloademacs-cb7f2e96771602fb73af13fbbcaec9d0063a3ba5.tar.gz
emacs-cb7f2e96771602fb73af13fbbcaec9d0063a3ba5.zip
Version from CC mode 5.28.
Diffstat (limited to 'man')
-rw-r--r--man/cc-mode.texi440
1 files changed, 208 insertions, 232 deletions
diff --git a/man/cc-mode.texi b/man/cc-mode.texi
index 69b3a2e3b45..b61c9a09580 100644
--- a/man/cc-mode.texi
+++ b/man/cc-mode.texi
@@ -7,8 +7,8 @@
7@comment No overfull hbox marks in the dvi file. 7@comment No overfull hbox marks in the dvi file.
8@finalout 8@finalout
9 9
10@setfilename ../info/ccmode 10@setfilename cc-mode.info
11@settitle CC Mode Version 5 Documentation 11@settitle CC Mode Manual
12@footnotestyle end 12@footnotestyle end
13 13
14@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 14@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -22,94 +22,54 @@
22@comment Texinfo manual for CC Mode 22@comment Texinfo manual for CC Mode
23@comment Generated from the original README file by Krishna Padmasola 23@comment Generated from the original README file by Krishna Padmasola
24@comment <krishna@earth-gw.njit.edu> 24@comment <krishna@earth-gw.njit.edu>
25@comment 25@comment
26@comment Authors:
27@comment Barry A. Warsaw
28@comment Martin Stjernholm
29@comment
26@comment Maintained by Martin Stjernholm <bug-cc-mode@gnu.org> 30@comment Maintained by Martin Stjernholm <bug-cc-mode@gnu.org>
27@comment 31@comment
28@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 32@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
29 33
30@comment Info directory entry for use by install-info 34@macro copyrightblurb
35Copyright @copyright{} 1995, 96, 97, 98, 99, 2000, 01 Free Software Foundation, Inc.
36@end macro
37
38@comment Info directory entry for use by install-info. The indentation
39@comment here is by request from the FSF folks.
31@dircategory Emacs 40@dircategory Emacs
32@direntry 41@direntry
33* CC Mode: (ccmode). Emacs mode for editing C, C++, Objective-C, 42* CC Mode: (cc-mode). Emacs mode for editing C, C++, Objective-C,
34 Java, Pike, and IDL code. 43 Java, Pike, and IDL code.
35@end direntry 44@end direntry
36 45
37@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 46@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38@comment The following line inserts the copyright notice 47@comment The following lines inserts the copyright notice
39@comment into the Info file. 48@comment into the Info file.
40@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 49@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
41 50
42@ifnottex 51@ifnottex
43Copyright @copyright{} 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. 52@copyrightblurb
44
45Permission is granted to copy, distribute and/or modify this document
46under the terms of the GNU Free Documentation License, Version 1.1 or
47any later version published by the Free Software Foundation; with the
48Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
49``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
50Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
51license is included in the section entitled ``GNU Free Documentation
52License'' in the Emacs manual.
53
54(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
55this GNU Manual, like GNU software. Copies published by the Free
56Software Foundation raise funds for GNU development.''
57
58This document is part of a collection distributed under the GNU Free
59Documentation License. If you want to distribute this document
60separately from the collection, you can do so by adding a copy of the
61license to the document, as described in section 6 of the license.
62@end ifnottex 53@end ifnottex
63 54
64@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 55@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
65@comment !!!The titlepage section does not appear in the Info file.!!! 56@comment TeX title page
66@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 57@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
67 58
68@titlepage 59@titlepage
69@sp 10 60@sp 10
70 61
71 62@center @titlefont{CC Mode 5.28}
72@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
73@comment The title is printed in a large font.
74@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
75
76@center @titlefont{CC Mode 5.27}
77@sp 2 63@sp 2
78@center @subtitlefont{A GNU Emacs mode for editing C and C-like languages} 64@center @subtitlefont{A GNU Emacs mode for editing C and C-like languages}
79@sp 2 65@sp 2
80@center Current maintainer: 66@center Barry A. Warsaw, Martin Stjernholm
81@center Martin Stjernholm
82
83
84@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
85@comment The following two commands start the copyright page
86@comment for the printed manual. This will not appear in the Info file.
87@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
88 67
89@page 68@page
90@vskip 0pt plus 1filll 69@vskip 0pt plus 1filll
91Copyright @copyright{} 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. 70@copyrightblurb
92@sp 1
93Permission is granted to copy, distribute and/or modify this document
94under the terms of the GNU Free Documentation License, Version 1.1 or
95any later version published by the Free Software Foundation; with the
96Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
97``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
98Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
99license is included in the section entitled ``GNU Free Documentation
100License'' in the Emacs manual.
101
102(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
103this GNU Manual, like GNU software. Copies published by the Free
104Software Foundation raise funds for GNU development.''
105
106This document is part of a collection distributed under the GNU Free
107Documentation License. If you want to distribute this document
108separately from the collection, you can do so by adding a copy of the
109license to the document, as described in section 6 of the license.
110@end titlepage 71@end titlepage
111 72
112
113@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 73@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
114@comment The Top node contains the master menu for the Info file. 74@comment The Top node contains the master menu for the Info file.
115@comment This appears only in the Info file, not the printed manual. 75@comment This appears only in the Info file, not the printed manual.
@@ -146,11 +106,11 @@ font-locking; there are other Emacs packages for that.
146* Syntactic Symbols:: 106* Syntactic Symbols::
147* Indentation Functions:: 107* Indentation Functions::
148* Performance Issues:: 108* Performance Issues::
109* Limitations and Known Bugs::
149* Frequently Asked Questions:: 110* Frequently Asked Questions::
150* Getting the Latest CC Mode Release:: 111* Getting the Latest CC Mode Release::
151* Sample .emacs File::
152* Limitations and Known Bugs::
153* Mailing Lists and Submitting Bug Reports:: 112* Mailing Lists and Submitting Bug Reports::
113* Sample .emacs File::
154 114
155 --- Indices --- 115 --- Indices ---
156 116
@@ -229,7 +189,7 @@ As of 2000 Martin has taken over as the sole maintainer.
229 189
230This manual describes @ccmode{} 190This manual describes @ccmode{}
231@comment The following line must appear on its own, so that the automated 191@comment The following line must appear on its own, so that the automated
232version 5.27. 192version 5.28.
233@comment Release.py script can update the version number automatically 193@comment Release.py script can update the version number automatically
234 194
235@ccmode{} supports the editing of K&R and ANSI C, @dfn{ARM} 195@ccmode{} supports the editing of K&R and ANSI C, @dfn{ARM}
@@ -263,7 +223,7 @@ How to customize the new indentation engine.
263@findex java-mode 223@findex java-mode
264@findex idl-mode 224@findex idl-mode
265@findex pike-mode 225@findex pike-mode
266Note that the name of this package is ``@ccmode{},'' but there is no top 226Note that the name of this package is ``@ccmode{}'', but there is no top
267level @code{cc-mode} entry point. All of the variables, commands, and 227level @code{cc-mode} entry point. All of the variables, commands, and
268functions in @ccmode{} are prefixed with @code{c-@var{<thing>}}, and 228functions in @ccmode{} are prefixed with @code{c-@var{<thing>}}, and
269@code{c-mode}, @code{c++-mode}, @code{objc-mode}, @code{java-mode}, 229@code{c-mode}, @code{c++-mode}, @code{objc-mode}, @code{java-mode},
@@ -853,7 +813,7 @@ zero, hanging them can introduce performance problems.
853Using a mechanism similar to brace hanging (@pxref{Hanging Braces}), 813Using a mechanism similar to brace hanging (@pxref{Hanging Braces}),
854colons can also be made to hang using the style variable 814colons can also be made to hang using the style variable
855@code{c-hanging-colons-alist}. The syntactic symbols appropriate for 815@code{c-hanging-colons-alist}. The syntactic symbols appropriate for
856this assocation list are: @code{case-label}, @code{label}, 816this association list are: @code{case-label}, @code{label},
857@code{access-label}, @code{member-init-intro}, and @code{inher-intro}. 817@code{access-label}, @code{member-init-intro}, and @code{inher-intro}.
858Note however that for @code{c-hanging-colons-alist}, @var{ACTION}s as 818Note however that for @code{c-hanging-colons-alist}, @var{ACTION}s as
859functions are not supported. See also @ref{Custom Brace and Colon 819functions are not supported. See also @ref{Custom Brace and Colon
@@ -955,13 +915,15 @@ automatically.
955@cindex clean-ups 915@cindex clean-ups
956@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 916@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
957 917
958@dfn{Clean-ups} are a mechanism complementary to colon and brace 918@dfn{Clean-ups} are mechanisms complementary to colon and brace hanging.
959hanging. On the surface, it would seem that clean-ups overlap the 919On the surface, it would seem that clean-ups overlap the functionality
960functionality provided by the @code{c-hanging-*-alist} variables, and 920provided by the @code{c-hanging-*-alist} variables. Clean-ups are
961similarly, clean-ups are only enabled when auto-newline minor mode is 921however used to adjust code ``after-the-fact'', i.e. to adjust the
962enabled. Clean-ups are used however to adjust code ``after-the-fact,'' 922whitespace in constructs after they are typed.
963i.e. to eliminate some whitespace that is inserted by electric 923
964commands, or whitespace that contains intervening constructs. 924Most of the clean-ups are only applicable to counteract automatically
925inserted newlines, and will therefore only have any effect if the
926auto-newline minor mode is turned on. Others will work all the time.
965 927
966@vindex c-cleanup-list 928@vindex c-cleanup-list
967@vindex cleanup-list (c-) 929@vindex cleanup-list (c-)
@@ -974,12 +936,12 @@ performed when the construct does not occur within a literal
974(@pxref{Auto-newline Insertion}), and when there is nothing but 936(@pxref{Auto-newline Insertion}), and when there is nothing but
975whitespace appearing between the individual components of the construct. 937whitespace appearing between the individual components of the construct.
976 938
977There are currently only five specific constructs that @ccmode{} 939These are the clean-ups that only are active in the auto-newline minor
978can clean up, as indicated by these symbols: 940mode:
979 941
980@itemize @bullet 942@itemize @bullet
981@item 943@item
982@code{brace-else-brace} --- cleans up @samp{@} else @{} constructs by 944@code{brace-else-brace} --- Clean up @samp{@} else @{} constructs by
983placing the entire construct on a single line. Clean-up occurs when the 945placing the entire construct on a single line. Clean-up occurs when the
984open brace after the @samp{else} is typed. So for example, this: 946open brace after the @samp{else} is typed. So for example, this:
985@example 947@example
@@ -1011,7 +973,7 @@ void spam(int i)
1011@end example 973@end example
1012 974
1013@item 975@item
1014@code{brace-elseif-brace} --- similar to the @code{brace-else-brace} 976@code{brace-elseif-brace} --- Similar to the @code{brace-else-brace}
1015clean-up, but this cleans up @samp{@} else if (...) @{} constructs. For 977clean-up, but this cleans up @samp{@} else if (...) @{} constructs. For
1016example: 978example:
1017@example 979@example
@@ -1057,11 +1019,11 @@ void spam(int i)
1057@end example 1019@end example
1058 1020
1059@item 1021@item
1060@code{brace-catch-brace} --- analogous to @code{brace-elseif-brace}, but 1022@code{brace-catch-brace} --- Analogous to @code{brace-elseif-brace}, but
1061cleans up @samp{@} catch (...) @{} in C++ and Java mode. 1023cleans up @samp{@} catch (...) @{} in C++ and Java mode.
1062 1024
1063@item 1025@item
1064@code{empty-defun-braces} --- cleans up braces following a top-level 1026@code{empty-defun-braces} --- Clean up braces following a top-level
1065function or class definition that contains no body. Clean up occurs 1027function or class definition that contains no body. Clean up occurs
1066when the closing brace is typed. Thus the following: 1028when the closing brace is typed. Thus the following:
1067@example 1029@example
@@ -1085,9 +1047,9 @@ class Spam
1085@end example 1047@end example
1086 1048
1087@item 1049@item
1088@code{defun-close-semi} --- cleans up the terminating semi-colon on 1050@code{defun-close-semi} --- Clean up the terminating semi-colon on
1089top-level function or class definitions when they follow a close 1051top-level function or class definitions when they follow a close
1090brace. Clean up occurs when the semi-colon is typed. 1052brace. Clean up occurs when the semi-colon is typed.
1091So for example, the following: 1053So for example, the following:
1092@example 1054@example
1093@group 1055@group
@@ -1113,11 +1075,11 @@ class Spam
1113@end example 1075@end example
1114 1076
1115@item 1077@item
1116@code{list-close-comma} --- cleans up commas following braces in array 1078@code{list-close-comma} --- Clean up commas following braces in array
1117and aggregate initializers. Clean up occurs when the comma is typed. 1079and aggregate initializers. Clean up occurs when the comma is typed.
1118 1080
1119@item 1081@item
1120@code{scope-operator} --- cleans up double colons which may designate a 1082@code{scope-operator} --- Clean up double colons which may designate a
1121C++ scope operator split across multiple lines@footnote{Certain C++ 1083C++ scope operator split across multiple lines@footnote{Certain C++
1122constructs introduce ambiguous situations, so @code{scope-operator} 1084constructs introduce ambiguous situations, so @code{scope-operator}
1123clean-ups may not always be correct. This usually only occurs when 1085clean-ups may not always be correct. This usually only occurs when
@@ -1127,6 +1089,30 @@ in the @code{c-cleanup-list} when you are editing C++ code.
1127 1089
1128@end itemize 1090@end itemize
1129 1091
1092The following clean-ups are always active when they occur on
1093@code{c-cleanup-list}, and are thus not affected by the auto-newline
1094minor mode:
1095
1096@itemize @bullet
1097@item
1098@code{space-before-funcall} --- Insert a space between the function name
1099and the opening parenthesis of a function call. This produces function
1100calls in the style mandated by the GNU coding standards,
1101e.g. @samp{signal (SIGINT, SIG_IGN)} and @samp{abort ()}. Clean up
1102occurs when the opening parenthesis is typed.
1103
1104@item
1105@code{compact-empty-funcall} --- Clean up any space between the function
1106name and the opening parenthesis of a function call that have no
1107arguments. This is typically used together with
1108@code{space-before-funcall} if you prefer the GNU function call style
1109for functions with arguments but think it looks ugly when it's only an
1110empty parenthesis pair. I.e. you will get @samp{signal (SIGINT,
1111SIG_IGN)}, but @samp{abort()}. Clean up occurs when the closing
1112parenthesis is typed.
1113
1114@end itemize
1115
1130 1116
1131@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1117@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1132@node Hungry-deletion of Whitespace, , Auto-newline Insertion, Minor Modes 1118@node Hungry-deletion of Whitespace, , Auto-newline Insertion, Minor Modes
@@ -1145,7 +1131,7 @@ hungry-delete in @strong{all} your editing modes!
1145In a nutshell, when hungry-delete mode is enabled, hitting the 1131In a nutshell, when hungry-delete mode is enabled, hitting the
1146@key{Backspace} key@footnote{I say ``hit the @key{Backspace} key'' but 1132@key{Backspace} key@footnote{I say ``hit the @key{Backspace} key'' but
1147what I really mean is ``when Emacs receives the @code{BackSpace} key 1133what I really mean is ``when Emacs receives the @code{BackSpace} key
1148event.'' The difference usually isn't significant to most users, but 1134event''. The difference usually isn't significant to most users, but
1149advanced users will realize that under window systems such as X, any 1135advanced users will realize that under window systems such as X, any
1150physical key (keycap) on the keyboard can be configured to generate any 1136physical key (keycap) on the keyboard can be configured to generate any
1151keysym, and thus any Emacs key event. Also, the use of Emacs on TTYs 1137keysym, and thus any Emacs key event. Also, the use of Emacs on TTYs
@@ -1408,11 +1394,13 @@ The commands that does the actual work follows.
1408@findex c-fill-paragraph 1394@findex c-fill-paragraph
1409@findex fill-paragraph (c-) 1395@findex fill-paragraph (c-)
1410@cindex Javadoc markup 1396@cindex Javadoc markup
1397@cindex Pike autodoc markup
1411@item @kbd{M-q} (@code{c-fill-paragraph}) 1398@item @kbd{M-q} (@code{c-fill-paragraph})
1412This is the replacement for @code{fill-paragraph} in @ccmode{} 1399This is the replacement for @code{fill-paragraph} in @ccmode{}
1413buffers. It's used to fill multiline string literals and both block and 1400buffers. It's used to fill multiline string literals and both block and
1414line style comments. In Java buffers, the Javadoc markup words are 1401line style comments. In Java buffers, the Javadoc markup words are
1415recognized as paragraph starters. 1402recognized as paragraph starters. The line oriented Pike autodoc markup
1403words are recognized in the same way in Pike mode.
1416 1404
1417The function keeps the comment starters and enders of block comments as 1405The function keeps the comment starters and enders of block comments as
1418they were before the filling. This means that a comment ender on the 1406they were before the filling. This means that a comment ender on the
@@ -1692,18 +1680,18 @@ argument, move backward.
1692@findex beginning-of-statement (c-) 1680@findex beginning-of-statement (c-)
1693@item @kbd{M-a} (@code{c-beginning-of-statement}) 1681@item @kbd{M-a} (@code{c-beginning-of-statement})
1694Move point to the beginning of the innermost C statement. If point is 1682Move point to the beginning of the innermost C statement. If point is
1695already at the beginning of a statement, it moves to the beginning of 1683already at the beginning of a statement, move to the beginning of the
1696the closest preceding statement, even if that means moving into a block 1684closest preceding statement, even if that means moving into a block (you
1697(you can use @kbd{M-C-b} to move over a balanced block). With prefix 1685can use @kbd{M-C-b} to move over a balanced block). With prefix
1698argument @var{n}, move back @var{n} @minus{} 1 statements. 1686argument @var{n}, move back @var{n} @minus{} 1 statements.
1699 1687
1700If point is within a comment, or next to a comment, this command moves 1688If point is within or next to a comment or a string which spans more
1701by sentences instead of statements. 1689than one line, this command moves by sentences instead of statements.
1702 1690
1703When called from a program, this function takes three optional 1691When called from a program, this function takes three optional
1704arguments: the numeric prefix argument, a buffer position limit which is 1692arguments: the repetition count, a buffer position limit which is the
1705the farthest back to search, and a flag to enable moving by sentence 1693farthest back to search for the syntactic context, and a flag saying
1706inside comments. 1694whether to do sentence motion in or near comments and multiline strings.
1707 1695
1708@kindex M-e 1696@kindex M-e
1709@findex c-end-of-statement 1697@findex c-end-of-statement
@@ -1715,13 +1703,13 @@ inside a nested block (use @kbd{M-C-f} to move to the other side of the
1715block). With prefix argument @var{n}, move forward @var{n} @minus{} 1 1703block). With prefix argument @var{n}, move forward @var{n} @minus{} 1
1716statements. 1704statements.
1717 1705
1718If point is within a comment, or next to a comment, this command moves 1706If point is within or next to a comment or a string which spans more
1719by sentences instead of statements. 1707than one line, this command moves by sentences instead of statements.
1720 1708
1721When called from a program, this function takes three optional 1709When called from a program, this function takes three optional
1722arguments: the numeric prefix argument, a buffer position limit which is 1710arguments: the repetition count, a buffer position limit which is the
1723the farthest back to search, and a flag to enable moving by sentence 1711farthest back to search for the syntactic context, and a flag saying
1724inside comments. 1712whether to do sentence motion in or near comments and multiline strings.
1725 1713
1726@findex c-forward-into-nomenclature 1714@findex c-forward-into-nomenclature
1727@findex forward-into-nomenclature (c-) 1715@findex forward-into-nomenclature (c-)
@@ -1820,14 +1808,16 @@ function call programmatically!}.
1820@vindex c-basic-offset 1808@vindex c-basic-offset
1821@vindex basic-offset (c-) 1809@vindex basic-offset (c-)
1822The offset associated with any particular syntactic symbol can be any of 1810The offset associated with any particular syntactic symbol can be any of
1823an integer, a function or lambda expression, a variable name, or one of 1811an integer, a function or lambda expression, a variable name, a vector,
1824the following symbols: @code{+}, @code{-}, @code{++}, @code{--}, 1812a list, or one of the following symbols: @code{+}, @code{-}, @code{++},
1825@code{*}, or @code{/}. These latter describe offset in multiples of the 1813@code{--}, @code{*}, or @code{/}.
1826value of the style variable @code{c-basic-offset}. By defining a 1814
1827style's indentation in terms of this fundamental variable, you can 1815Those last special symbols describe an offset in multiples of the value
1828change the amount of whitespace given to an indentation level while 1816of the style variable @code{c-basic-offset}. By defining a style's
1829maintaining the same basic shape of your code. Here are the values that 1817indentation in terms of this fundamental variable, you can change the
1830the special symbols correspond to: 1818amount of whitespace given to an indentation level while maintaining the
1819same basic shape of your code. Here are the values that the special
1820symbols correspond to:
1831 1821
1832@table @code 1822@table @code
1833 1823
@@ -1854,6 +1844,9 @@ syntactic symbol is needed to get the desired indentation.
1854@xref{Indentation Functions}, and @ref{Custom Indentation Functions}, 1844@xref{Indentation Functions}, and @ref{Custom Indentation Functions},
1855for details about them. 1845for details about them.
1856 1846
1847If the offset is a vector, its first element sets the absolute
1848indentation column, which will override any relative indentation.
1849
1857@vindex c-strict-syntax-p 1850@vindex c-strict-syntax-p
1858@vindex strict-syntax-p (c-) 1851@vindex strict-syntax-p (c-)
1859The offset can also be a list, in which case it is evaluated recursively 1852The offset can also be a list, in which case it is evaluated recursively
@@ -2133,15 +2126,14 @@ The language hooks get run as the last thing when you enter that
2133language mode. The @code{c-mode-common-hook} is run by all supported 2126language mode. The @code{c-mode-common-hook} is run by all supported
2134modes @emph{before} the language specific hook, and thus can contain 2127modes @emph{before} the language specific hook, and thus can contain
2135customizations that are common across all languages. Most of the 2128customizations that are common across all languages. Most of the
2136examples in this section will assume you are using the common 2129examples in this section will assume you are using the common hook.
2137hook.@footnote{@code{java-mode} and the hook variables interact in a 2130
2138slightly different way than the other modes. @code{java-mode} normally 2131Note that all the language-specific mode setup that CC Mode does is done
2139sets the style of the buffer to @samp{java} @emph{before} running the 2132prior to both @code{c-mode-common-hook} and the language specific hook.
2140@code{c-mode-common-hook} or @code{java-mode-hook}. You need to be 2133That includes installing the indentation style, which can be mode
2141aware of this so that style settings in @code{c-mode-common-hook} don't 2134specific (and also is by default for Java mode). Thus, any style
2142clobber your Java style. This is arguably bogus, but it's kept for 2135settings done in @code{c-mode-common-hook} will override whatever
2143historical reasons. @xref{Built-in Styles}, the documentation of 2136language-specific style is chosen by @code{c-default-style}.
2144@code{c-default-style}, for details.}
2145 2137
2146Here's a simplified example of what you can add to your @file{.emacs} 2138Here's a simplified example of what you can add to your @file{.emacs}
2147file to do things whenever any @ccmode{} language is edited. See the 2139file to do things whenever any @ccmode{} language is edited. See the
@@ -2285,14 +2277,14 @@ Whitesmiths C, an early commercial C compiler.
2285@cindex Ellemtel style 2277@cindex Ellemtel style
2286@item 2278@item
2287@code{ellemtel} --- Popular C++ coding standards as defined by 2279@code{ellemtel} --- Popular C++ coding standards as defined by
2288``Programming in C++, Rules and Recommendations,'' Erik Nyquist and Mats 2280``Programming in C++, Rules and Recommendations'', Erik Nyquist and Mats
2289Henricson, Ellemtel@footnote{This document is available at 2281Henricson, Ellemtel@footnote{This document is available at
2290@uref{http://www.doc.ic.ac.uk/lab/cplus/c++.rules/} among other 2282@uref{http://www.doc.ic.ac.uk/lab/cplus/c++.rules/} among other
2291places.}. 2283places.}.
2292 2284
2293@cindex Linux style 2285@cindex Linux style
2294@item 2286@item
2295@code{linux} --- C coding standard for Linux (the kernel). 2287@code{linux} --- C coding standard for Linux development.
2296 2288
2297@cindex Python style 2289@cindex Python style
2298@item 2290@item
@@ -2304,8 +2296,9 @@ foreign function interface. For more information, see
2304@cindex Java style 2296@cindex Java style
2305@findex java-mode 2297@findex java-mode
2306@item 2298@item
2307@code{java} --- The style for editing Java code. Note that this style is 2299@code{java} --- The style for editing Java code. Note that the default
2308automatically installed when you enter @code{java-mode}. 2300value for @code{c-default-style} installs this style when you enter
2301@code{java-mode}.
2309 2302
2310@cindex User style 2303@cindex User style
2311@item 2304@item
@@ -2343,9 +2336,7 @@ mode. Here are the rules:
2343@item 2336@item
2344When @code{c-default-style} is a string, it must be an existing style 2337When @code{c-default-style} is a string, it must be an existing style
2345name as found in @code{c-style-alist}. This style is then used for all 2338name as found in @code{c-style-alist}. This style is then used for all
2346modes @emph{except} @code{java-mode}, where the style @samp{java} is 2339modes.
2347used by default@footnote{This is for backwards compatibility reasons.
2348The hard-coding of @code{java-mode} style is admittedly bogus!}.
2349 2340
2350@item 2341@item
2351When @code{c-default-style} is an association list, the current major 2342When @code{c-default-style} is an association list, the current major
@@ -3722,7 +3713,7 @@ For every function below there is a ``works with'' list that indicates
3722which syntactic symbols the function is intended to be used with. 3713which syntactic symbols the function is intended to be used with.
3723 3714
3724@macro workswith 3715@macro workswith
3725@emph{Works with:} 3716@emph{Works with:@ }
3726@end macro 3717@end macro
3727@ifinfo 3718@ifinfo
3728@unmacro workswith 3719@unmacro workswith
@@ -4173,9 +4164,9 @@ In the first case the indentation is kept unchanged, in the second
4173@findex c-lineup-dont-change 4164@findex c-lineup-dont-change
4174@findex lineup-dont-change (c-) 4165@findex lineup-dont-change (c-)
4175@item c-lineup-dont-change 4166@item c-lineup-dont-change
4176This lineup function returns the indentation of the current line. Think 4167This lineup function makes the line stay at whatever indentation it
4177of it as an identity function for lineups; it is used for 4168already has; think of it as an identity function for lineups. It is
4178@code{cpp-macro-cont} lines. 4169used for @code{cpp-macro-cont} lines.
4179 4170
4180@workswith Any syntactic symbol. 4171@workswith Any syntactic symbol.
4181 4172
@@ -4183,7 +4174,7 @@ of it as an identity function for lineups; it is used for
4183 4174
4184 4175
4185@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4176@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4186@node Performance Issues, Frequently Asked Questions, Indentation Functions, Top 4177@node Performance Issues, Limitations and Known Bugs, Indentation Functions, Top
4187@comment node-name, next, previous, up 4178@comment node-name, next, previous, up
4188@chapter Performance Issues 4179@chapter Performance Issues
4189@cindex performance issues 4180@cindex performance issues
@@ -4283,10 +4274,47 @@ use here; you should read the comments at the top of the file, and look
4283at the variable @code{cc-lobotomy-pith-list} for details. 4274at the variable @code{cc-lobotomy-pith-list} for details.
4284 4275
4285 4276
4277@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4278@node Limitations and Known Bugs, Frequently Asked Questions, Performance Issues, Top
4279@comment node-name, next, previous, up
4280@chapter Limitations and Known Bugs
4281@cindex limitations
4282@cindex bugs
4283@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4284
4285@itemize @bullet
4286@item
4287Re-indenting large regions or expressions can be slow.
4288
4289@findex c-indent-exp
4290@findex indent-exp (c-)
4291@item
4292@code{c-indent-exp} has not been fully optimized. It essentially
4293equivalent to hitting @kbd{TAB} (@code{c-indent-command}) on every
4294line. Some information is cached from line to line, but such caching
4295invariable causes inaccuracies in analysis in some bizarre situations.
4296
4297@vindex signal-error-on-buffer-boundary
4298@item
4299XEmacs versions from 19.15 until (as of this writing 12-Mar-1998) 20.4
4300contain a variable called @code{signal-error-on-buffer-boundary}. This
4301was intended as a solution to user interface problems associated with
4302buffer movement and the @code{zmacs-region} deactivation on errors.
4303However, setting this variable to a non-default value had the
4304deleterious side effect of breaking many built-in primitive functions.
4305Most users will not be affected since they never change the value of
4306this variable. @strong{Do not set this variable to @code{nil}}; you
4307will cause serious problems in @ccmode{} and probably other XEmacs
4308packages! As of at least XEmacs 20.4, the effects this variable tried
4309to correct have been fixed in other, better ways.
4310
4311@end itemize
4312
4313
4286@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4314@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4287@node Frequently Asked Questions, Getting the Latest CC Mode Release, Performance Issues, Top 4315@node Frequently Asked Questions, Getting the Latest CC Mode Release, Limitations and Known Bugs, Top
4288@comment node-name, next, previous, up 4316@comment node-name, next, previous, up
4289@chapter Frequently Asked Questions 4317@appendix Frequently Asked Questions
4290@cindex frequently asked questions 4318@cindex frequently asked questions
4291@cindex FAQ 4319@cindex FAQ
4292@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4320@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -4342,7 +4370,7 @@ in my @file{.emacs} file but I get an error saying that
4342 4370
4343@strong{A.} This means that @ccmode{} wasn't loaded into your 4371@strong{A.} This means that @ccmode{} wasn't loaded into your
4344Emacs session by the time the @code{c-set-offset} call was reached, 4372Emacs session by the time the @code{c-set-offset} call was reached,
4345mostly likely because @ccmode{} is being autoloaded. Instead 4373most likely because @ccmode{} is being autoloaded. Instead
4346of putting the @code{c-set-offset} line in your top-level 4374of putting the @code{c-set-offset} line in your top-level
4347@file{.emacs} file, put it in your @code{c-mode-common-hook}, or 4375@file{.emacs} file, put it in your @code{c-mode-common-hook}, or
4348simply modify @code{c-offsets-alist} directly: 4376simply modify @code{c-offsets-alist} directly:
@@ -4353,23 +4381,6 @@ simply modify @code{c-offsets-alist} directly:
4353@end example 4381@end example
4354 4382
4355@sp 1 4383@sp 1
4356@strong{Q.} @emph{My style settings works in all the @ccmode{} language
4357modes except for Java, where I still get e.g. 4 column indentation.}
4358
4359@strong{A.} Java mode switches to the @samp{java} style by default for
4360historical reasons. You can override it by putting an association list
4361on @code{c-default-style}:
4362@example
4363
4364(setq c-default-style '((other . "my-style")))
4365
4366@end example
4367@noindent
4368The @samp{other} symbol says that @ccmode{} should use "my-style" in all
4369modes not explicitly listed. Since there's nothing else on the list
4370this causes "my-style" to be used in every mode.
4371
4372@sp 1
4373@strong{Q.} @emph{How do I make strings, comments, keywords, and other 4384@strong{Q.} @emph{How do I make strings, comments, keywords, and other
4374constructs appear in different colors, or in bold face, etc.?} 4385constructs appear in different colors, or in bold face, etc.?}
4375 4386
@@ -4405,9 +4416,9 @@ in the @file{README} file.
4405 4416
4406 4417
4407@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4418@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4408@node Getting the Latest CC Mode Release, Sample .emacs File, Frequently Asked Questions, Top 4419@node Getting the Latest CC Mode Release, Mailing Lists and Submitting Bug Reports, Frequently Asked Questions, Top
4409@comment node-name, next, previous, up 4420@comment node-name, next, previous, up
4410@chapter Getting the Latest CC Mode Release 4421@appendix Getting the Latest CC Mode Release
4411@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4422@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4412 4423
4413@ccmode{} is standard with all versions of Emacs since 19.34 and of 4424@ccmode{} is standard with all versions of Emacs since 19.34 and of
@@ -4433,10 +4444,52 @@ distribution (named @code{cc-mode.tar.gz}; a gzip'd tar file), or any of
4433the individual files, including PostScript documentation. 4444the individual files, including PostScript documentation.
4434 4445
4435 4446
4447@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4448@node Mailing Lists and Submitting Bug Reports, Sample .emacs File, Getting the Latest CC Mode Release, Top
4449@comment node-name, next, previous, up
4450@appendix Mailing Lists and Submitting Bug Reports
4451@cindex mailing lists
4452@cindex reporting bugs
4453@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4454
4455@kindex C-c C-b
4456@findex c-submit-bug-report
4457@findex submit-bug-report (c-)
4458To report bugs, use the @kbd{C-c C-b} (@code{c-submit-bug-report})
4459command. This provides vital information we need to reproduce your
4460problem. Make sure you include a concise, but complete code example.
4461Please try to boil your example down to just the essential code needed
4462to reproduce the problem, and include an exact recipe of steps needed to
4463expose the bug. Be especially sure to include any code that appears
4464@emph{before} your bug example, if you think it might affect our ability
4465to reproduce it.
4466
4467Please try to produce the problem in an Emacs instance without any
4468customizations loaded (i.e. start it with the @code{-q -no-site-file}
4469arguments). If it works correctly there, the problem might be caused by
4470faulty customizations in either your own or your site configuration. In
4471that case, we'd appreciate if you isolate the Emacs Lisp code that trigs
4472the bug and include it in your report.
4473
4474@cindex bug report mailing list
4475Bug reports are now sent to the following email addresses:
4476@email{bug-cc-mode@@gnu.org} and @email{bug-gnu-emacs@@gnu.org}; the
4477latter is mirrored on the Usenet newsgroup @code{gnu.emacs.bug}. You
4478can send other questions and suggestions (kudos? @t{;-)} to
4479@email{bug-cc-mode@@gnu.org}.
4480
4481@cindex announcement mailing list
4482If you want to get announcements of new @ccmode{} releases, send the
4483word @emph{subscribe} in the body of a message to
4484@email{cc-mode-announce-request@@lists.sourceforge.net}. Announcements
4485will also be posted to the Usenet newsgroups @code{gnu.emacs.sources},
4486@code{comp.emacs} and @code{comp.emacs.xemacs}.
4487
4488
4436@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4489@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4437@node Sample .emacs File, Limitations and Known Bugs, Getting the Latest CC Mode Release, Top 4490@node Sample .emacs File, Concept Index, Mailing Lists and Submitting Bug Reports, Top
4438@comment node-name, next, previous, up 4491@comment node-name, next, previous, up
4439@chapter Sample .emacs file 4492@appendix Sample .emacs file
4440@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4493@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4441 4494
4442@example 4495@example
@@ -4490,88 +4543,7 @@ the individual files, including PostScript documentation.
4490 4543
4491 4544
4492@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4545@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4493@node Limitations and Known Bugs, Mailing Lists and Submitting Bug Reports, Sample .emacs File, Top 4546@node Concept Index, Command Index, Sample .emacs File, Top
4494@comment node-name, next, previous, up
4495@chapter Limitations and Known Bugs
4496@cindex limitations
4497@cindex bugs
4498@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4499
4500@itemize @bullet
4501@item
4502Re-indenting large regions or expressions can be slow.
4503
4504@findex c-indent-exp
4505@findex indent-exp (c-)
4506@item
4507@code{c-indent-exp} has not been fully optimized. It essentially
4508equivalent to hitting @kbd{TAB} (@code{c-indent-command}) on every
4509line. Some information is cached from line to line, but such caching
4510invariable causes inaccuracies in analysis in some bizarre situations.
4511
4512@vindex signal-error-on-buffer-boundary
4513@item
4514XEmacs versions from 19.15 until (as of this writing 12-Mar-1998) 20.4
4515contain a variable called @code{signal-error-on-buffer-boundary}. This
4516was intended as a solution to user interface problems associated with
4517buffer movement and the @code{zmacs-region} deactivation on errors.
4518However, setting this variable to a non-default value had the
4519deleterious side effect of breaking many built-in primitive functions.
4520Most users will not be affected since they never change the value of
4521this variable. @strong{Do not set this variable to @code{nil}}; you
4522will cause serious problems in @ccmode{} and probably other XEmacs
4523packages! As of at least XEmacs 20.4, the effects this variable tried
4524to correct have been fixed in other, better ways.
4525
4526@end itemize
4527
4528
4529@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4530@node Mailing Lists and Submitting Bug Reports, Concept Index, Limitations and Known Bugs, Top
4531@comment node-name, next, previous, up
4532@chapter Mailing Lists and Submitting Bug Reports
4533@cindex mailing lists
4534@cindex reporting bugs
4535@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4536
4537@kindex C-c C-b
4538@findex c-submit-bug-report
4539@findex submit-bug-report (c-)
4540To report bugs, use the @kbd{C-c C-b} (@code{c-submit-bug-report})
4541command. This provides vital information we need to reproduce your
4542problem. Make sure you include a concise, but complete code example.
4543Please try to boil your example down to just the essential code needed
4544to reproduce the problem, and include an exact recipe of steps needed to
4545expose the bug. Be especially sure to include any code that appears
4546@emph{before} your bug example, if you think it might affect our ability
4547to reproduce it.
4548
4549Please try to produce the problem in an Emacs instance without any
4550customizations loaded (i.e. start it with the @code{-q -no-site-file}
4551arguments). If it works correctly there, the problem might be caused by
4552faulty customizations in either your own or your site configuration. In
4553that case, we'd appreciate if you isolate the Emacs Lisp code that trigs
4554the bug and include it in your report.
4555
4556Bug reports are now sent to the following email addresses:
4557@email{bug-cc-mode@@gnu.org} and @email{bug-gnu-emacs@@gnu.org}; the
4558latter is mirrored on the Usenet newsgroup @code{gnu.emacs.bug}. You
4559can send other questions and suggestions (kudos? @t{;-)} to
4560@email{bug-cc-mode@@gnu.org}, or @email{help-gnu-emacs@@gnu.org} which is
4561mirrored on newsgroup @code{gnu.emacs.help}.
4562
4563@cindex beta testers mailing list
4564@cindex announcement mailing list
4565If you want to get announcements of new @ccmode{} releases, send the
4566word @emph{subscribe} in the body of a message to
4567@email{cc-mode-announce-request@@lists.sourceforge.net}. Announcements
4568will also be posted to the Usenet newsgroups @code{gnu.emacs.sources},
4569@code{comp.emacs}, @code{comp.emacs.xemacs}, and possibly some of the
4570language oriented newsgroups.
4571
4572
4573@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4574@node Concept Index, Command Index, Mailing Lists and Submitting Bug Reports, Top
4575@comment node-name, next, previous, up 4547@comment node-name, next, previous, up
4576@unnumbered Concept Index 4548@unnumbered Concept Index
4577@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4549@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -4616,7 +4588,11 @@ Since most @ccmode{} variables are prepended with the string
4616@sp 2 4588@sp 2
4617@end iftex 4589@end iftex
4618@printindex vr 4590@printindex vr
4591
4592@iftex
4619@page 4593@page
4620@summarycontents 4594@summarycontents
4621@contents 4595@contents
4596@end iftex
4597
4622@bye 4598@bye