aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Stjernholm2003-07-03 12:49:26 +0000
committerMartin Stjernholm2003-07-03 12:49:26 +0000
commitb5a670812e64e5cfcdd65ec3f7156eb964fe445b (patch)
tree00bda7c2b9fbd70d21aa554c28f066feb22f7210
parentd9e94c22736810b8bd61964a322ecc9664e09e14 (diff)
downloademacs-b5a670812e64e5cfcdd65ec3f7156eb964fe445b.tar.gz
emacs-b5a670812e64e5cfcdd65ec3f7156eb964fe445b.zip
CC Mode 5.30 news.
-rw-r--r--etc/NEWS271
1 files changed, 271 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 50ce22a37c7..8d7e05e3387 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -936,6 +936,277 @@ will read from standard input and mark the produced tags as belonging to
936the file FILE. 936the file FILE.
937 937
938+++ 938+++
939** CC Mode changes.
940
941*** Font lock support.
942CC Mode now provides font lock support for all its languages. This
943supersedes the font lock patterns that have been in the core font lock
944package for C, C++, Java and Objective-C. Like indentation, font
945locking is done in a uniform way across all languages (except the new
946AWK mode - see below). That means that the new font locking will be
947different from the old patterns in various details for most languages.
948
949The main goal of the font locking in CC Mode is accuracy, to provide a
950dependable aid in recognizing the various constructs. Some, like
951strings and comments, are easy to recognize while others like
952declarations and types can be very tricky. CC Mode can go to great
953lengths to recognize declarations and casts correctly, especially when
954the types aren't recognized by standard patterns. This is a fairly
955demanding analysis which can be slow on older hardware, and it can
956therefore be disabled by choosing a lower decoration level with the
957variable font-lock-maximum-decoration.
958
959Note that the most demanding font lock level has been tuned with lazy
960fontification in mind, i.e. there should be a support mode that waits
961with the fontification until the text is actually shown
962(e.g. Just-in-time Lock mode, which is the default, or Lazy Lock
963mode). Fontifying a file with several thousand lines in one go can
964take the better part of a minute.
965
966**** The (c|c++|objc|java|idl|pike)-font-lock-extra-types variables
967are now used by CC Mode to recognize identifiers that are certain to
968be types. (They are also used in cases that aren't related to font
969locking.) At the maximum decoration level, types are often recognized
970properly anyway, so these variables should be fairly restrictive and
971not contain patterns for uncertain types.
972
973**** Support for documentation comments.
974There is a "plugin" system to fontify documentation comments like
975Javadoc and the markup within them. It's independent of the host
976language, so it's possible to e.g. turn on Javadoc font locking in C
977buffers. See the variable c-doc-comment-style for details.
978
979Currently two kinds of doc comment styles are recognized: Suns Javadoc
980and Autodoc which is used in Pike. This is by no means a complete
981list of the most common tools; if your doc comment extractor of choice
982is missing then please drop a note to bug-cc-mode@gnu.org.
983
984**** Better handling of C++ templates.
985As a side effect of the more accurate font locking, C++ templates are
986now handled much better. The angle brackets that delimit them are
987given parenthesis syntax so that they can be navigated like other
988parens.
989
990This also improves indentation of templates, although there still is
991work to be done in that area. E.g. it's required that multiline
992template clauses are written in full and then refontified to be
993recognized, and the indentation of nested templates is a bit odd and
994not as configurable as it ought to be.
995
996**** Improved handling of Objective-C and CORBA IDL.
997Especially the support for Objective-C and IDL has gotten an overhaul.
998The special "@" declarations in Objective-C are handled correctly.
999All the keywords used in CORBA IDL, PSDL, and CIDL are recognized and
1000handled correctly, also wrt indentation.
1001
1002*** Support for the AWK language.
1003Support for the AWK language has been introduced. The implementation is
1004based around GNU AWK version 3.1, but it should work pretty well with
1005any AWK. As yet, not all features of CC Mode have been adapted for AWK.
1006Here is a summary:
1007
1008**** Indentation Engine
1009The CC Mode indentation engine fully supports AWK mode.
1010
1011AWK mode handles code formatted in the conventional AWK fashion: `{'s
1012which start actions, user-defined functions, or compound statements are
1013placed on the same line as the associated construct; the matching `}'s
1014are normally placed under the start of the respective pattern, function
1015definition, or structured statement.
1016
1017The predefined indentation functions haven't yet been adapted for AWK
1018mode, though some of them may work serendipitously. There shouldn't be
1019any problems writing custom indentation functions for AWK mode.
1020
1021The command C-c C-q (c-indent-defun) hasn't yet been adapted for AWK,
1022though in practice it works properly nearly all the time. Should it
1023fail, explicitly set the region around the function (using C-u C-SPC:
1024C-M-h probably won't work either) then do C-M-\ (indent-region).
1025
1026**** Font Locking
1027There is a single level of font locking in AWK mode, rather than the
1028three distinct levels the other modes have. There are several
1029idiosyncrasies in AWK mode's font-locking due to the peculiarities of
1030the AWK language itself.
1031
1032**** Comment Commands
1033M-; (indent-for-comment) works fine. None of the other CC Mode
1034comment formatting commands have yet been adapted for AWK mode.
1035
1036**** Movement Commands
1037Most of the movement commands work in AWK mode. The most important
1038exceptions are M-a (c-beginning-of-statement) and M-e
1039(c-end-of-statement) which haven't yet been adapted.
1040
1041The notion of "defun" has been augmented to include AWK pattern-action
1042pairs. C-M-a (c-awk-beginning-of-defun) and C-M-e (c-awk-end-of-defun)
1043recognise these pattern-action pairs, as well as user defined
1044functions.
1045
1046**** Auto-newline Insertion and Clean-ups
1047Auto-newline insertion hasn't yet been adapted for AWK. Some of
1048the clean-ups can actually convert good AWK code into syntactically
1049invalid code. These features are best disabled in AWK buffers.
1050
1051*** New syntactic symbols in IDL mode.
1052The top level constructs "module" and "composition" (from CIDL) are
1053now handled like "namespace" in C++: They are given syntactic symbols
1054module-open, module-close, inmodule, composition-open,
1055composition-close, and incomposition.
1056
1057*** New functions to do hungry delete without enabling hungry delete mode.
1058The functions c-hungry-backspace and c-hungry-delete-forward can be
1059bound to keys to get this feature without toggling a mode.
1060Contributed by Kevin Ryde.
1061
1062*** Better control over require-final-newline.
1063The variable that controls how to handle a final newline when the
1064buffer is saved, require-final-newline, is now customizable on a
1065per-mode basis through c-require-final-newline. The default is to set
1066it to t only in languages that mandate a final newline in source files
1067(C, C++ and Objective-C).
1068
1069*** Slight API change for the syntactic context used by lineup functions.
1070The syntactic context stored in c-syntactic-context has been changed
1071to allow more information. This might affect custom lineup functions,
1072but only if they use that variable directly. See its docstring for
1073more details.
1074
1075*** API changes for derived modes.
1076There have been extensive changes "under the hood" which can affect
1077derived mode writers. Some of these changes are likely to cause
1078incompatibilities with existing derived modes, but on the other hand
1079care has now been taken to make it possible to extend and modify CC
1080Mode with less risk of such problems in the future.
1081
1082**** New language variable system.
1083See the comment blurb near the top of cc-langs.el.
1084
1085**** New initialization functions.
1086The initialization procedure has been split up into more functions to
1087give better control: c-basic-common-init, c-font-lock-init, and
1088c-init-language-vars.
1089
1090*** Changes in analysis of nested syntactic constructs.
1091The syntactic analysis engine has better handling of cases where
1092several syntactic constructs appear nested on the same line. They are
1093now handled as if each construct started on a line of its own.
1094
1095This means that CC Mode now indents some cases differently, and
1096although it's more consistent there might be cases where the old way
1097gave results that's more to one's liking. So if you find a situation
1098where you think that the indentation has become worse, please report
1099it to bug-cc-mode@gnu.org.
1100
1101**** New syntactic symbol substatement-label.
1102This symbol is used when a label is inserted between a statement and
1103its substatement. E.g:
1104
1105 if (x)
1106 x_is_true:
1107 do_stuff();
1108
1109*** Better handling of multiline macros.
1110
1111**** Syntactic indentation inside macros.
1112The contents of multiline #define's are now analyzed and indented
1113syntactically just like other code. This can be disabled by the new
1114variable c-syntactic-indentation-in-macros. A new syntactic symbol
1115cpp-define-intro has been added to control the initial indentation
1116inside #define's.
1117
1118**** New lineup function c-lineup-cpp-define.
1119Now used by default to line up macro continuation lines. The behavior
1120of this function closely mimics the indentation one gets if the macro
1121is indented while the line continuation backslashes are temporarily
1122removed. If syntactic indentation in macros is turned off, it works
1123much line c-lineup-dont-change, which was used earlier, but handles
1124empty lines within the macro better.
1125
1126**** Automatically inserted newlines continues the macro if used within one.
1127This applies to the newlines inserted by the auto-newline mode, and to
1128c-context-line-break and c-context-open-line.
1129
1130**** Better alignment of line continuation backslashes.
1131c-backslash-region tries to adapt to surrounding backslashes. New
1132variable c-backslash-max-column which put a limit on how far out
1133backslashes can be moved.
1134
1135**** Automatic alignment of line continuation backslashes.
1136This is controlled by the new variable c-auto-align-backslashes. It
1137affects c-context-line-break, c-context-open-line and newlines
1138inserted in auto-newline mode.
1139
1140**** Line indentation works better inside macros.
1141Regardless whether syntactic indentation and syntactic indentation
1142inside macros are enabled or not, line indentation now ignores the
1143line continuation backslashes. This is most noticeable when syntactic
1144indentation is turned off and there are empty lines (save for the
1145backslash) in the macro.
1146
1147*** indent-for-comment is more customizable.
1148The behavior of M-; (indent-for-comment) is now configurable through
1149the variable c-indent-comment-alist. The indentation behavior based
1150on the preceding code on the line, e.g. to get two spaces after #else
1151and #endif but indentation to comment-column in most other cases
1152(something which was hardcoded earlier).
1153
1154*** New function c-context-open-line.
1155It's the open-line equivalent of c-context-line-break.
1156
1157*** New lineup functions
1158
1159**** c-lineup-string-cont
1160This lineup function lines up a continued string under the one it
1161continues. E.g:
1162
1163result = prefix + "A message "
1164 "string."; <- c-lineup-string-cont
1165
1166**** c-lineup-cascaded-calls
1167Lines up series of calls separated by "->" or ".".
1168
1169**** c-lineup-knr-region-comment
1170Gives (what most people think is) better indentation of comments in
1171the "K&R region" between the function header and its body.
1172
1173**** c-lineup-gcc-asm-reg
1174Provides better indentation inside asm blocks. Contributed by Kevin
1175Ryde.
1176
1177**** c-lineup-argcont
1178Lines up continued function arguments after the preceding comma.
1179Contributed by Kevin Ryde.
1180
1181*** Better caching of the syntactic context.
1182CC Mode caches the positions of the opening parentheses (of any kind)
1183of the lists surrounding the point. Those positions are used in many
1184places as anchor points for various searches. The cache is now
1185improved so that it can be reused to a large extent when the point is
1186moved. The less it moves, the less needs to be recalculated.
1187
1188The effect is that CC Mode should be fast most of the time even when
1189opening parens are hung (i.e. aren't in column zero). It's typically
1190only the first time after the point is moved far down in a complex
1191file that it'll take noticeable time to find out the syntactic
1192context.
1193
1194*** Statements are recognized in a more robust way.
1195Statements are recognized most of the time even when they occur in an
1196"invalid" context, e.g. in a function argument. In practice that can
1197happen when macros are involved.
1198
1199*** Improved the way c-indent-exp chooses the block to indent.
1200It now indents the block for the closest sexp following the point
1201whose closing paren ends on a different line. This means that the
1202point doesn't have to be immediately before the block to indent.
1203Also, only the block and the closing line is indented; the current
1204line is left untouched.
1205
1206*** Added toggle for syntactic indentation.
1207The function c-toggle-syntactic-indentation can be used to toggle
1208syntactic indentation.
1209
939** The command line option --no-windows has been changed to 1210** The command line option --no-windows has been changed to
940--no-window-system. The old one still works, but is deprecated. 1211--no-window-system. The old one still works, but is deprecated.
941 1212