Mercurial > emacs
comparison lisp/ChangeLog @ 44728:7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
version.
author | Martin Stjernholm <mast@lysator.liu.se> |
---|---|
date | Mon, 22 Apr 2002 00:35:36 +0000 |
parents | 867beadfbb38 |
children | 712ef4d4683e |
comparison
equal
deleted
inserted
replaced
44727:3936c522b4d3 | 44728:7a3ac6c387fe |
---|---|
1 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
2 | |
3 * progmodes/cc-mode.el: (c-define-abbrev-table): New function to | |
4 pass the SYSTEM-FLAG to `define-abbrev' in a way that works in | |
5 emacsen that doesn't support it. | |
6 | |
7 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
8 | |
9 * progmodes/cc-align.el, progmodes/cc-engine.el, | |
10 progmodes/cc-styles.el, progmodes/cc-vars.el | |
11 (c-guess-basic-syntax, c-lineup-topmost-intro-cont): Find | |
12 correct anchor for statement-cont in top level constructs. | |
13 Analyze variable initializations in top level constructs as | |
14 topmost-intro-cont instead of statement-cont. That is an | |
15 incompatible change but it gives better consistency. The new | |
16 lineup function c-lineup-topmost-intro-cont' compensates for | |
17 it and is now put on topmost-intro-cont by default. | |
18 | |
19 * progmodes/cc-align.el, progmodes/cc-engine.el, | |
20 progmodes/cc-langs.el (c-lineup-argcont): Lineup function | |
21 contributed by Kevin Ryde. | |
22 | |
23 (c-in-gcc-asm-p): Function to recognize asm statements. | |
24 Contributed by Kevin Ryde. | |
25 | |
26 (c-opt-asm-stmt-key): New language variable to recognize the | |
27 beginning of asm statements. | |
28 | |
29 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
30 | |
31 * progmodes/cc-engine.el (c-guess-basic-syntax): Detect | |
32 variable declarations after class and struct declarations | |
33 correctly. Fixed limit error when finding the anchor for | |
34 template-args-cont and topmost-intro-cont. | |
35 | |
36 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
37 | |
38 * progmodes/cc-cmds.el (c-beginning-of-defun, | |
39 c-declaration-limits): Find the "line oriented" declaration | |
40 start too, just like the "line oriented" end is found. | |
41 | |
42 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
43 | |
44 * progmodes/cc-vars.el (c-offsets-alist): A more sane default | |
45 for `inexpr-statement'. This is not compatible, though. I | |
46 think the benefit of a good default style outweights that in | |
47 this case. Besides, `inexpr-statement' is not very common. | |
48 | |
49 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
50 | |
51 * progmodes/cc-cmds.el (c-electric-delete-forward): Fixed | |
52 silly bug that caused it to delete backwards in hungry delete | |
53 mode. (It's amazing that this bug hasn't been reported.) | |
54 | |
55 * progmodes/cc-cmds.el (c-declaration-limits, c-mark-function): | |
56 Extracted the code to get the declaration limits from | |
57 `c-mark-function' to a new `c-declaration-limits'. | |
58 | |
59 (c-indent-defun): Use the same method to get the limits of the | |
60 declaration or macro as `c-mark-function'. | |
61 | |
62 * progmodes/cc-engine.el (c-beginning-of-decl-1): Handle brace | |
63 list initializers correctly (but costly; it ought to be | |
64 integrated into `c-beginning-of-statement-1'). | |
65 | |
66 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
67 | |
68 * progmodes/cc-cmds.el, progmodes/cc-engine.el | |
69 (c-beginning-of-defun, c-end-of-defun, c-mark-function): | |
70 Rewritten to detect the declaration limits better. Now | |
71 handles K&R argdecls, class definitions followed by variables | |
72 etc. | |
73 | |
74 (c-in-knr-argdecl): Broke out the K&R argdecl test in | |
75 `c-beginning-of-decl-1' to this new function. | |
76 | |
77 (c-end-of-statement-1, c-end-of-decl-1): Replaced | |
78 `c-end-of-statement-1' with `c-end-of-decl-1', which correctly | |
79 handles declarations that continue after the block. | |
80 | |
81 * progmodes/cc-engine.el (c-syntactic-re-search-forward): | |
82 Added an option to restrict matching to the top level of the | |
83 current paren sexp. | |
84 | |
85 * progmodes/cc-langs.el (c-opt-block-decls-with-vars-key): New | |
86 regexp to recognize declarations that continue after the | |
87 block. | |
88 | |
89 (c-syntactic-eol): New regexp to match a "syntactic" eol. | |
90 | |
91 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
92 | |
93 * progmodes/cc-engine.el (c-guess-basic-syntax): Fixed a bug | |
94 that often caused the backward limit to be lost at the top | |
95 level. This improves performance a bit. | |
96 | |
97 * progmodes/cc-engine.el (c-syntactic-re-search-forward): New | |
98 function that works like `re-search-forward' but only returns | |
99 matches in syntactically significant text. | |
100 | |
101 * progmodes/cc-engine.el: Fixed a faster and more accurate way | |
102 to recognize K&R argdecls. | |
103 | |
104 (c-beginning-of-decl-1): New function that put point at the | |
105 beginning of the declaration. It handles K&R argdecl blocks. | |
106 | |
107 (c-guess-basic-syntax): Replaced the `knr-argdecl' recognition | |
108 code with one that doesn't depend on the current indentation. | |
109 The anchor position for `knr-argdecl' has also changed, but in | |
110 a way that is unlikely to cause compatibility problems. | |
111 | |
112 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
113 | |
114 * progmodes/cc-defs.el, progmodes/cc-engine.el | |
115 (c-forward-comment): `forward-comment' in XEmacs skips over | |
116 line continuations in the backward direction. Correct for | |
117 that. Also made this a defun since it has grown too large now | |
118 to be a defsubst. | |
119 | |
120 * progmodes/cc-langs.el: More convenient and decentralized | |
121 setup of the language specific variables. The regexp-opt | |
122 mangling is also done at compile time now. | |
123 | |
124 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
125 | |
126 * progmodes/cc-cmds.el (c-indent-line-or-region): Call | |
127 `c-indent-line' directly instead of through | |
128 `indent-according-to-mode' so that this function always | |
129 indents syntactically. | |
130 | |
131 * progmodes/cc-engine.el (c-guess-basic-syntax): Fixed a bug | |
132 where a class beginning with a nested class could cause an | |
133 infinite loop (the state outside the narrowed out class is | |
134 never used now). | |
135 | |
136 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
137 | |
138 * progmodes/cc-align.el, progmodes/cc-cmds.el, | |
139 progmodes/cc-engine.el, progmodes/cc-vars.el: Fixes so that | |
140 the context sensitive analysis inside macros is restricted to | |
141 the bodies of #define's; other things, like #if expressions, | |
142 never have anything in common with their surroundings. The | |
143 old `cpp-macro-cont' syntax is now used in situations where | |
144 the syntactic analysis isn't applicable, and a new syntactic | |
145 element `cpp-define-intro' is used to add indentation in | |
146 #define bodies. | |
147 | |
148 (c-lineup-cpp-define): New name for `c-lineup-macro-cont' to | |
149 better reflect its use. | |
150 | |
151 * progmodes/cc-engine.el (c-guess-basic-syntax): Ignore line | |
152 continuation backslashes in the detection of | |
153 `arglist-cont-nonempty'. | |
154 | |
155 * progmodes/cc-align.el: Use the vector form in the return | |
156 value in all cases where lineup functions return absolute | |
157 columns. | |
158 | |
159 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
160 | |
161 * progmodes/cc-engine.el (c-add-stmt-syntax, | |
162 c-guess-basic-syntax): Anchor `brace-list-intro' and | |
163 `bracec-list-close' better for brace lists nested inside | |
164 expressions. | |
165 | |
166 * progmodes/cc-engine.el, progmodes/cc-langs.el, | |
167 progmodes/cc-mode.el, progmodes/cc-styles.el: Cleaned up the | |
168 various language specific variables and their initialization. | |
169 The keyword regexps are now lists that are combined with | |
170 regexp-opt. Some variables have changed names to fit better | |
171 with the naming convention. | |
172 | |
173 * progmodes/cc-defs.el, progmodes/cc-vars.el | |
174 (c-buffer-is-cc-mode): The value is the mode symbol of the | |
175 original CC Mode mode. | |
176 | |
177 (c-major-mode-is): Compare against the buffer local variable | |
178 `c-buffer-is-cc-mode', which is faster than using | |
179 `derived-mode-class'. | |
180 | |
181 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
182 | |
183 * progmodes/cc-engine.el (c-forward-syntactic-ws, | |
184 c-backward-syntactic-ws, c-forward-token-1, | |
185 c-backward-token-1, c-in-literal, c-literal-limits, | |
186 c-collect-line-comments, c-literal-type, c-on-identifier, | |
187 c-guess-basic-syntax): These functions are now considered part | |
188 of the "CC Mode API" and may be used by other code. That's | |
189 signified by making their documentation into docstrings. | |
190 | |
191 (c-whack-state, c-hack-state, c-skip-case-statement-forward): | |
192 Removed these internal functions since they aren't used. | |
193 | |
194 (c-forward-to-cpp-expression): Classified this function as | |
195 internal. | |
196 | |
197 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
198 | |
199 * progmodes/cc-langs.el (c-ObjC-class-key, c-Java-class-key): | |
200 Simplified these regexps; the class keywords they contain | |
201 ought to be enough to avoid false matches, so checking for | |
202 following identifiers etc is just unnecessary (and might also | |
203 fail for oddly formatted code). | |
204 | |
205 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
206 | |
207 * progmodes/cc-engine.el, progmodes/cc-cmds.el | |
208 (c-forward-comment-lc): New function that behaves like | |
209 `c-forward-comment', with the exception that line | |
210 continuations are treated as whitespace. | |
211 | |
212 (c-beginning-of-statement): Use `c-forward-comment-lc', to | |
213 work correctly in macros and other places where line | |
214 continuations should be treated as whitespace. | |
215 | |
216 * progmodes/cc-engine.el (c-guess-basic-syntax): Analyze a | |
217 normal label in a switch block as a case label, to get | |
218 consistent lineup with the case labels. | |
219 | |
220 * progmodes/cc-engine.el (c-backward-syntactic-ws): Fixed bug | |
221 in skipping over a macro that ends with an empty line. | |
222 | |
223 * progmodes/cc-styles.el: Require cc-align since styles added | |
224 with `c-add-style' often contains references to functions | |
225 defined there, and so the `c-valid-offset' check might | |
226 otherwise complain on them. | |
227 | |
228 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
229 | |
230 * progmodes/cc-align.el, progmodes/cc-mode.texi, | |
231 progmodes/cc-vars.el: Added two new lineup functions: | |
232 | |
233 (c-lineup-knr-region-comment): A new lineup function to get | |
234 (what most people think is) better indentation of comments in | |
235 the "K&R region" between the function header and its body. | |
236 | |
237 (c-lineup-gcc-asm-reg): New lineup function for better | |
238 indentation inside gcc asm blocks. Contributed by Kevin Ryde. | |
239 | |
240 (c-offsets-alist): Use `c-lineup-gcc-asm-reg' and | |
241 `c-lineup-knr-region-comment' in the default offset | |
242 configuration, since these two functions have little impact | |
243 outside their intended use, and they generally do the right | |
244 thing when they kick in. | |
245 | |
246 * progmodes/cc-engine.el (c-guess-continued-construct, | |
247 c-guess-basic-syntax): Handle nested functions in all | |
248 languages, not just Pike. In C and C++ there's a gcc | |
249 extension for this, and it also gives better treatment of | |
250 macros that are followed by blocks. | |
251 | |
252 * progmodes/cc-langs.el (c-symbol-key): Made this variable | |
253 mode specific, to handle Pike special symbols like `== better. | |
254 | |
255 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
256 | |
257 * progmodes/cc-cmds.el, progmodes/cc-engine.el, | |
258 progmodes/cc-vars.el (c-report-syntactic-errors): A new | |
259 variable to control the syntactic error messages. It defaults | |
260 to off; since CC Mode ignores most syntactic errors it might | |
261 as well ignore them all for the sake of consistency. | |
262 | |
263 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
264 | |
265 * progmodes/cc-engine.el (c-looking-at-inexpr-block): | |
266 Optimization. Can give a noticeable speedup if there's a | |
267 large preceding function or class body. | |
268 | |
269 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
270 | |
271 * progmodes/cc-align.el, progmodes/cc-cmds.el: Use more | |
272 efficient and correct insertion functions in many places. | |
273 Always inherit text properties correctly if the text is | |
274 permanent. Also do it for speed in temporary insertions, | |
275 since I figure it's less work to continue the surrounding text | |
276 properties than to break them. | |
277 | |
278 * progmodes/cc-styles.el (c-read-offset): Unbind SPC in the | |
279 completion to make it easier to enter lists. | |
280 | |
281 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
282 | |
283 * progmodes/cc-cmds.el (c-beginning-of-defun): Fixed bug where | |
284 c-state-cache was clobbered. | |
285 | |
286 * progmodes/cc-cmds.el, progmodes/cc-engine.el | |
287 (c-calculate-state): Moved from cc-cmds.el to cc-engine.el due | |
288 to dependency. | |
289 | |
290 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
291 | |
292 * progmodes/cc-engine.el (c-parse-state): Ignore unbalanced | |
293 open parens in macros (if point isn't in the same one). | |
294 | |
295 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
296 | |
297 * progmodes/cc-cmds.el (c-context-open-line): New function | |
298 that is the `open-line' equivalent to `c-context-line-break'. | |
299 | |
300 * progmodes/cc-mode.el (c-mode-base-map): Compatibility fix | |
301 for Emacs 21 since `indent-new-comment-line' has been changed | |
302 to `comment-indent-new-line' there. | |
303 | |
304 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
305 | |
306 * progmodes/cc-engine.el, progmodes/cc-langs.el | |
307 (c-stmt-delim-chars, c-stmt-delim-chars-with-comma): New | |
308 variables containing the character sets used to recognize | |
309 statement/declaration boundaries. These variables might help | |
310 to support languages like javascript and awk, where newlines | |
311 sometimes delimits statements. | |
312 | |
313 (c-crosses-statement-barrier-p): Use `c-stmt-delim-chars' as | |
314 the set of statement delimiting characters, to allow it to be | |
315 changed dynamically and per-mode. | |
316 | |
317 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
318 | |
319 * progmodes/cc-engine.el (c-looking-at-bos, | |
320 c-looking-at-inexpr-block, c-add-stmt-syntax, | |
321 c-guess-basic-syntax): Treat blocks directly inside function | |
322 calls like "bare" statements inside function calls, and not | |
323 like in-expression statements. This to make indentation of | |
324 such blocks consistent with other statements inside macro | |
325 calls. | |
326 | |
327 * progmodes/cc-engine.el (c-guess-basic-syntax): Made | |
328 arglist-cont anchor correctly in arglists that contain | |
329 statements. | |
330 | |
331 * progmodes/cc-engine.el (c-guess-basic-syntax): Fixed | |
332 consistent anchoring of defun-block-intro in defuns in code | |
333 blocks (can only occur in Pike). | |
334 | |
335 * progmodes/cc-engine.el (c-looking-at-inexpr-block, | |
336 c-looking-at-inexpr-block-backward): Changed the arguments to | |
337 require containing sexps and paren state, for better | |
338 efficiency. | |
339 | |
340 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
341 | |
342 * progmodes/cc-cmds.el, progmodes/cc-engine.el, | |
343 progmodes/cc-vars.el: Improved anchoring of statement and | |
344 handling of labels in front of substatements. | |
345 | |
346 (c-guess-continued-construct, c-guess-basic-syntax): Improved | |
347 and unified anchoring at statements. Statements beginning | |
348 with comments or labels are now avoided, by going out of | |
349 blocks and containing statements if necessary. This nesting | |
350 handling also fixes the case when there's a statement after a | |
351 block open brace. Added the syntactic symbol | |
352 `substatement-label'. | |
353 | |
354 (c-electric-colon): Map the new `substatement-label' to | |
355 `label' when consulting `c-hanging-colons-alist'. | |
356 | |
357 (c-offsets-alist): Added substatement-label. Updated the | |
358 comments for the new anchoring positions at statements. | |
359 | |
360 * progmodes/cc-engine.el (c-guess-basic-syntax): Use more sane | |
361 anchor points for knr-argdecl-intro and access-label. They | |
362 used to refer to some point on the same line, a bug which was | |
363 neutralized by a kludge in `c-get-syntactic-indentation' which | |
364 ignored such anchor points. | |
365 | |
366 (c-get-syntactic-indentation): Removed the kludge that was | |
367 necessary due to buggy anchor points. | |
368 | |
369 * progmodes/cc-engine.el (c-guess-basic-syntax): Do not check | |
370 the absence of a comma before arglist-close (case 7A) in any | |
371 language, since there's nothing better to do that case anyway. | |
372 Added special case to make in-expression statements be | |
373 recognized as normal arglist-cont if we're directly in a macro | |
374 arglist, for consistency with other "bare" statements. | |
375 | |
376 * progmodes/cc-engine.el (c-looking-at-bos): Added optional | |
377 limit arg for backward searches. | |
378 | |
379 * progmodes/cc-engine.el (c-looking-at-inexpr-block): Anchor | |
380 gcc in-expression statements at the surrounding open | |
381 parenthesis. Treat a class body as an in-expression class if | |
382 it's used in an object clone expression in Pike. | |
383 | |
384 * progmodes/cc-engine.el (c-get-offset, | |
385 c-get-syntactic-indentation): Allow several anchor positions | |
386 in the list of syntactic symbols. Only the first is used as | |
387 the base for the offset calculation. | |
388 | |
389 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
390 | |
391 * progmodes/cc-cmds.el (c-indent-defun): Indent the current | |
392 macro if inside one at the top level. Do not throw an error | |
393 if used at the top level outside a macro. | |
394 | |
395 * progmodes/cc-cmds.el (c-backslash-region): Do tab width | |
396 alignment only if the backslashes can't be aligned with | |
397 surrounding backslashes. | |
398 | |
399 * progmodes/cc-engine.el (c-end-of-macro): New function. | |
400 | |
401 * progmodes/cc-engine.el (c-least-enclosing-brace): Rewritten | |
402 to not be destructive. | |
403 | |
404 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
405 | |
406 * progmodes/cc-cmds.el (c-context-line-break): Only do a macro | |
407 line break when point is inside the content of it; if it's in | |
408 the cpp keyword a normal line break is done. | |
409 | |
410 * progmodes/cc-engine.el (c-guess-basic-syntax): Do not add | |
411 cpp-macro-cont inside the argument list to a #define. | |
412 | |
413 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
414 | |
415 * progmodes/cc-defs.el (c-forward-comment): Implemented a | |
416 kludge to avoid the problem most forward-comment incarnations | |
417 have with `\' together with comment parsing. | |
418 | |
419 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
420 | |
421 * progmodes/cc-engine.el (c-check-state-cache): Fixed bug | |
422 which could cause the state returned by `c-parse-state' to | |
423 lack a closed paren element. That in turn could result in | |
424 very long searches, since it's common that they start from the | |
425 last preceding close brace. | |
426 | |
427 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
428 | |
429 * progmodes/cc-engine.el (c-beginning-of-statement-1): Do not | |
430 treat else-if as a single continuation, since that'd make it | |
431 hard to get the right anchor point when there's a line break | |
432 between the two keywords. This change causes else-clause to | |
433 be anchored on the closest preceding else-if and not always on | |
434 the starting if, but that doesn't affect the indentation for | |
435 any reasonably sane style. Also introduced a noerror flag. | |
436 | |
437 (c-beginning-of-closest-statement): Removed; | |
438 c-beginning-of-statement-1 now avoids the problem this one | |
439 solved. | |
440 | |
441 * progmodes/cc-engine.el (c-guess-continued-construct, | |
442 c-guess-basic-syntax): Better and more uniform anchor points | |
443 for 'statement-cont and 'substatement. The effect is | |
444 noticeable mostly when there's a label on the same line as the | |
445 beginning of the statement, or when there are more stuff | |
446 before the start of the statement. | |
447 | |
448 * progmodes/cc-engine.el (c-looking-at-inexpr-block): Added | |
449 flag to disable looking at the type of the surrounding paren | |
450 since that confuses c-beginning-of-statement-1 and a couple of | |
451 other places. | |
452 | |
453 * progmodes/cc-engine.el (c-guess-basic-syntax): Avoid | |
454 stepping to the previous statement in case 18. Improvements | |
455 in recognition of statement blocks on the top level. | |
456 | |
457 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
458 | |
459 * progmodes/cc-engine.el (c-beginning-of-statement-1, | |
460 c-crosses-statement-barrier-p): Rewritten to get a well | |
461 defined and documented behavior. This fixes some tricky cases | |
462 in recognition of do-while constructs. | |
463 | |
464 (c-backward-to-start-of-do, c-backward-to-start-of-if): | |
465 Removed; use c-beginning-of-statement-1 instead. | |
466 | |
467 (c-guess-continued-construct, c-guess-basic-syntax): Various | |
468 fixes to not depend on the bugs previously in | |
469 c-beginning-of-statement-1. Cleanups in cases 18 and 17 to | |
470 use the new behavior of c-beginning-of-statement-1 better. | |
471 Fixed recognition of catch blocks inside macros. | |
472 | |
473 * progmodes/cc-engine.el (c-backward-syntactic-ws): Fixed bug | |
474 in skipping over a macro. | |
475 | |
476 * progmodes/cc-langs.el (c-label-kwds): New variable to | |
477 contain the appropriate c-*-label-kwds value. | |
478 | |
479 * progmodes/cc-vars.el (defcustom-c-stylevar): Fixed value | |
480 evaluation bug that caused the widget for | |
481 c-block-comment-prefix to bug out. | |
482 | |
483 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
484 | |
485 * progmodes/cc-engine.el (c-guess-basic-syntax): Improved | |
486 recognition of statements: They are now recognized in contexts | |
487 where they normally can't occur, e.g. on the top level or in | |
488 function call arguments. This is mainly useful to recognize | |
489 statements in macros at the top level, and in arguments to | |
490 macros. The cases has been moved around quite a bit, and case | |
491 10 has been copied to case 18. (The cases has not been | |
492 renumbered because of this.) | |
493 | |
494 (c-guess-continued-construct): New function which has the | |
495 rules which are common between cases 10 and 18. | |
496 | |
497 * progmodes/cc-engine.el (c-beginning-of-statement-1, | |
498 c-backward-to-start-of-do, c-backward-to-start-of-if): Fixes | |
499 so that they really obey the passed limits. | |
500 | |
501 (c-safe-position): Return nil if the state doesn't contain a | |
502 suitable position. | |
503 | |
504 (c-guess-basic-syntax): Fixes some too short limits in calls | |
505 to c-beginning-of-statement-1. Some fixes for top level | |
506 analysis in ObjC mode. | |
507 | |
508 * progmodes/cc-engine.el (c-beginning-of-statement-1): Fixed | |
509 bug in do-while statements where the body is not a block. | |
510 | |
511 * progmodes/cc-styles.el (c-set-style): Reset | |
512 c-special-indent-hook to its global value if in override mode. | |
513 Fixes problem where functions on that hook remained after | |
514 style switch. | |
515 | |
516 * progmodes/cc-engine.el (c-evaluate-offset, c-get-offset): | |
517 Use c-benign-error to report the c-strict-syntax-p error. | |
518 | |
519 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
520 | |
521 * progmodes/cc-align.el, progmodes/cc-defs.el, | |
522 progmodes/cc-cmds.el, progmodes/cc-engine.el, cc-vars.el: | |
523 Several fixes to treat macros as code and not literals and to | |
524 handle line continuations transparently. | |
525 | |
526 (c-skip-ws-forward, c-skip-ws-backward): New macros to skip | |
527 through whitespace and line continuations, but not comments | |
528 and macros. | |
529 | |
530 (c-in-literal): No longer recognizes macros as literals by | |
531 default. An extra flag argument is required to do that. | |
532 | |
533 (c-macro-start, c-query-macro-start, | |
534 c-query-and-set-macro-start): Added a cache for the macro | |
535 start position. | |
536 | |
537 (c-forward-syntactic-ws, c-backward-syntactic-ws): Fixes for | |
538 more speed when limits are given. Workaround for bad behavior | |
539 in forward-comment in some emacsen when it hits a buffer limit | |
540 with a large repeat count. | |
541 | |
542 (c-lineup-macro-cont): Improved behavior when | |
543 c-syntactic-indentation-in-macros is nil. | |
544 | |
545 (c-syntactic-indentation-in-macros, c-backslash-max-column, | |
546 c-auto-align-backslashes): New customization variables to | |
547 control macro handling. | |
548 | |
549 * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): | |
550 Fixes to handle line continuations. | |
551 | |
552 * progmodes/cc-defs.el, progmodes/cc-styles.el | |
553 (c-get-style-variables, c-set-offset): Report style errors | |
554 with message and ding instead of error signal. This to avoid | |
555 interrupted mode init if there's some style problem. | |
556 | |
557 (c-benign-error): New macro to report errors that doesn't need | |
558 to interrupt the operation. | |
559 | |
560 * progmodes/cc-defs.el (c-point): Added eonl and eopl | |
561 positions. | |
562 | |
563 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
564 | |
565 * progmodes/cc-cmds.el (c-electric-brace, c-indent-region): | |
566 Removed most of the c-state-cache fiddling, since the global | |
567 state cache now handles this. | |
568 | |
569 * progmodes/cc-engine.el (c-guess-basic-syntax): Fixed bug | |
570 when there's an open paren at the very first char of the | |
571 visible buffer region. | |
572 | |
573 * progmodes/cc-engine.el (c-parse-state, c-check-state-cache): | |
574 Cache the state globally and invalidate it below every buffer | |
575 change with the new after change function | |
576 `c-check-state-cache'. This gives a considerable performance | |
577 boost when editing large functions or classes. | |
578 | |
579 * progmodes/cc-engine.el (c-whack-state-after): Slight | |
580 optimization. | |
581 | |
582 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
583 | |
584 * progmodes/cc-engine.el, progmodes/cc-langs.el, | |
585 progmodes/cc-align.el: Improvements to syntactic analysis | |
586 inside macros: | |
587 | |
588 (c-block-stmt-1-kwds, c-block-stmt-2-kwds): New variables used | |
589 by `c-guess-basic-syntax'. | |
590 | |
591 (c-parse-state): Fixed bug with braces inside macros when | |
592 using cached state info. | |
593 | |
594 (c-forward-to-cpp-expression): New function to aid in | |
595 syntactic analysis inside macros. | |
596 | |
597 (c-beginning-of-statement-1, c-backward-syntactic-ws): Fixes | |
598 to work better inside macros. | |
599 | |
600 (c-forward-syntactic-ws): Whitespace between the # and the | |
601 command should be allowed in preprocessor directives. | |
602 | |
603 (c-lineup-macro-cont): New lineup function to get context | |
604 sensitive indentation inside macros. | |
605 | |
606 (c-offsets-alist): Made `c-lineup-macro-cont' the default for | |
607 cpp-macro-cont. | |
608 | |
609 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
610 | |
611 * progmodes/cc-engine.el (c-beginning-of-statement-1, | |
612 c-forward-syntactic-ws): Fixes to handle continued lines. | |
613 | |
614 (c-backward-to-start-of-if, c-guess-basic-syntax): Do | |
615 syntactic analysis inside macros. | |
616 | |
617 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
618 | |
619 * progmodes/cc-cmds.el (c-indent-region): Did a speedup made | |
620 possible by the more flexible state cache. | |
621 | |
622 * progmodes/cc-engine.el (c-parse-state, c-whack-state-before, | |
623 c-whack-state-after, c-hack-state, | |
624 c-narrow-out-enclosing-class, c-guess-basic-syntax): Improved | |
625 the state cache system. It now can use partial info from an | |
626 old cached state to calculate a new one at a different | |
627 position. Removed some kludges to avoid the state cache. The | |
628 new functions `c-whack-state-before' and `c-whack-state-after' | |
629 replace the now obsolete `c-whack-state'. | |
630 | |
631 * progmodes/cc-engine.el (c-beginning-of-statement-1): | |
632 Optimized backing through a macro. This can speed things up | |
633 quite a bit when there are long macros before point. | |
634 | |
635 (c-beginning-of-macro): Do not ignore the limit. | |
636 | |
637 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
638 | |
639 * progmodes/cc-cmds.el (c-electric-continued-statement): Fixed | |
640 a bug where the keyword wasn't reindented correctly if | |
641 followed by another keyword or identifier. | |
642 | |
643 * progmodes/cc-engine.el (c-parse-state): Ignore closed brace | |
644 pairs that are in macros. Fixes some cases where e.g. the | |
645 second of two "do { } while (0)" macros after each other | |
646 indented differently. | |
647 | |
648 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
649 | |
650 * progmodes/cc-engine.el (c-beginning-of-macro, | |
651 c-forward-syntactic-ws): Recognize "#!" as a preprocessor | |
652 directive when it begins a line, to allow for script | |
653 interpreter lines like "#!/usr/bin/pike" at the beginning of | |
654 the file. | |
655 | |
656 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
657 | |
658 * progmodes/cc-engine.el (c-looking-at-inexpr-block): | |
659 Recognize brace blocks inside a parenthesis expression as | |
660 inexpr-statement. Useful when writing statements as macro | |
661 arguments. | |
662 | |
663 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
664 | |
665 * progmodes/cc-cmds.el (c-fill-paragraph, c-do-auto-fill, | |
666 c-mask-comment): Broke out the comment masking code from | |
667 `c-fill-paragraph' to a new function `c-mask-comment', to be | |
668 able to do the same thing in `c-do-auto-fill'. This should | |
669 make auto-fill-mode behave better. | |
670 | |
671 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
672 | |
673 * progmodes/cc-cmds.el (c-electric-brace, c-electric-paren): | |
674 Check `executing-macro' to avoid blinking parens when macros | |
675 are executed. | |
676 | |
677 * progmodes/cc-mode.el, progmodes/cc-styles.el | |
678 (c-setup-filladapt): Moved from cc-mode.el to cc-styles.el for | |
679 consistency with `c-setup-paragraph-variables' (which was | |
680 placed there due to the dependency from `c-set-style'). | |
681 | |
682 * progmodes/cc-styles.el, progmodes/cc-vars.el: Fixed bug with | |
683 incomplete initialization from the style variable fallbacks if | |
684 there already is a style called "user" defined when CC Mode | |
685 starts up for the first time. | |
686 | |
687 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
688 | |
689 * progmodes/cc-cmds.el, progmodes/cc-vars.el | |
690 (c-comment-indent, c-indent-comment-alist): Added new variable | |
691 `c-indent-comment-alist' to allow better control over | |
692 `c-comment-indent'. | |
693 | |
694 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
695 | |
696 * progmodes/cc-align.el (c-lineup-C-comments): Try to match | |
697 both `comment-start-skip' and the comment prefix on the | |
698 current line with the comment starter, so that we line up | |
699 comments which matches `c-comment-prefix-regexp' on the first | |
700 line (after the `/') without the need to make | |
701 `comment-start-skip' match whatever `c-comment-prefix-regexp' | |
702 matches. | |
703 | |
704 * progmodes/cc-mode.el, progmodes/cc-styles.el (c-common-init, | |
705 c-set-style-1, c-setup-paragraph-variables): Moved the | |
706 variable initialization based on `c-comment-prefix-regexp' to | |
707 a new function `c-setup-paragraph-variables', which is now | |
708 used both at mode init and when a style that sets | |
709 `c-comment-prefix-regexp' is activated. | |
710 | |
711 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
712 | |
713 * progmodes/cc-engine.el (c-beginning-of-member-init-list): | |
714 Better handling of C++ template args to avoid confusion with | |
715 `<' and `>' used as operators in member init expressions. | |
716 | |
717 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
718 | |
719 * progmodes/cc-engine.el (c-most-enclosing-brace, | |
720 c-least-enclosing-brace): Added optional second arg to limit | |
721 the search to before a certain point. | |
722 | |
723 * progmodes/cc-engine.el (c-guess-basic-syntax): Fixed bug | |
724 which could cause incorrect analysis if a cached state is used | |
725 (usually only happens when an electric key reindents a line). | |
726 | |
727 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
728 | |
729 * progmodes/cc-defs.el (c-forward-comment): More idiosyncrasy | |
730 insulation. This time for XEmacs 21. | |
731 | |
732 * progmodes/cc-engine.el, progmodes/cc-langs.el: Improved | |
733 handling of inheritance lists: | |
734 | |
735 (c-beginning-of-inheritance-list): Rewritten to use a more | |
736 syntactically correct method that doesn't get confused by | |
737 badly placed linebreaks and comments. | |
738 | |
739 (c-guess-basic-syntax): Several fixes to the handling of | |
740 inheritance lists in combination with templates. 'inher-intro | |
741 is now anchored on the start of the class declaration and not | |
742 the indentation of the current line. Switched places on cases | |
743 5D.3 and 5D.4 and made them use more syntactically correct | |
744 methods. | |
745 | |
746 (c-inher-key): Removed since the code in | |
747 `c-guess-basic-syntax' now uses token-based search. | |
748 | |
749 * progmodes/cc-cmds.el, progmodes/cc-mode.el (c-mode-menu): | |
750 Added a submenu to access some toggles. | |
751 | |
752 (c-toggle-syntactic-indentation): New function to toggle the | |
753 variable `c-syntactic-indentation'. | |
754 | |
755 * progmodes/cc-styles.el (c-set-style): Improved the error | |
756 message for incorrect offsets a bit. | |
757 | |
758 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
759 | |
760 * progmodes/cc-cmds.el (c-indent-exp): Don't require that the | |
761 sexp follows point immediately, instead find the closest | |
762 following open paren that ends on another line. | |
763 | |
764 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
765 | |
766 * progmodes/cc-align.el (c-lineup-cascaded-calls): New | |
767 indentation function. | |
768 | |
769 * progmodes/cc-engine.el (c-beginning-of-macro): Bugfix for | |
770 directives with whitespace between the '#' and the name. | |
771 | |
772 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
773 | |
774 * progmodes/cc-engine.el (c-forward-syntactic-ws, | |
775 c-backward-syntactic-ws): Handle line continuations as | |
776 whitespace. Don't move past a macro if that'd take us past | |
777 the limit. | |
778 | |
779 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
780 | |
781 * progmodes/cc-engine.el (c-beginning-of-macro, | |
782 c-forward-syntactic-ws): Multiline strings begin with `#"' in | |
783 Pike, and that shouldn't be confused with a preprocessor | |
784 directive. | |
785 | |
786 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
787 | |
788 * progmodes/cc-cmds.el: Extended the kludge to interoperate | |
789 with the delsel and pending-del packages wrt to the new | |
790 function `c-electric-delete-forward'. | |
791 | |
792 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
793 | |
794 * progmodes/cc-cmds.el (c-indent-exp): Keep the indentation of | |
795 the block itself, i.e. only indent the contents in it. | |
796 | |
797 * progmodes/cc-styles.el (c-set-style): Use the default | |
798 argument to completing-read instead of initial-contents, if | |
799 the function is recent enough to support it. | |
800 | |
801 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
802 | |
803 * progmodes/cc-mode.el (c-mode-help-address): Removed | |
804 bug-gnu-emacs@gnu.org from the receiver list for bug reports. | |
805 I've almost never seen a bug reported this way that should go | |
806 to that list, but it's rather common that the reports concern | |
807 the combination CC Mode and XEmacs instead. | |
808 | |
809 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
810 | |
811 * progmodes/cc-cmds.el (c-electric-paren): Fixed bug when both | |
812 brace-elseif-brace and brace-catch-brace are active and | |
813 there's a "else if"-block before the catch block. | |
814 | |
815 * progmodes/cc-menus.el (cc-imenu-c++-generic-expression): | |
816 Detect function headers that span lines. | |
817 | |
818 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
819 | |
820 * progmodes/cc-cmds.el (c-electric-brace, | |
821 c-electric-semi&comma, c-electric-colon, c-electric-paren): | |
822 Check for last on line only for doing the auto-newline-mode | |
823 stuff, not for the reindentation. | |
824 | |
825 * progmodes/cc-cmds.el (c-electric-brace): Fixed bugs in the | |
826 handling of c-syntactic-indentation: When it's nil, indent the | |
827 new lines but don't reindent the current one. Reindent the | |
828 line only when the inserted brace comes first on it, instead | |
829 of last. | |
830 | |
831 * progmodes/cc-cmds.el (c-electric-brace, | |
832 c-electric-semi&comma): Fixed two places where | |
833 c-syntactic-indentation wasn't heeded. | |
834 | |
835 * progmodes/cc-cmds.el (c-electric-pound): Don't be electric | |
836 inside a macro. | |
837 | |
838 * progmodes/cc-engine.el (c-backward-to-start-of-if): Try a | |
839 little harder to find a fallback position when an orphan else | |
840 is found. Fixed case where an else following a do-while | |
841 statement could be associated with an if inside the do-while. | |
842 | |
843 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
844 | |
845 * progmodes/cc-cmds.el (c-guess-fill-prefix): Tuned the dwim | |
846 for the fallback to add a single space after the comment | |
847 prefix. | |
848 | |
849 * progmodes/cc-cmds.el (c-indent-new-comment-line): Somewhat | |
850 better behavior in some special cases, especially for | |
851 single-line comments. Avoid breaking up a comment starter or | |
852 ender. | |
853 | |
854 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
855 | |
856 * progmodes/cc-cmds.el (c-outline-level): Applied patch from | |
857 the Emacs sources to make this work in invisible text. | |
858 | |
859 * progmodes/cc-langs.el (c-switch-label-key): Fixed regexp to | |
860 not be confused by a later ':' on the same line as the label. | |
861 | |
862 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
863 | |
864 * progmodes/cc-cmds.el, progmodes/cc-mode.el | |
865 (c-electric-delete, c-electric-delete-forward): Split | |
866 `c-electric-delete' into two functions where | |
867 `c-electric-delete-forward' always deletes forward and | |
868 `c-electric-delete' only contains the code necessary for | |
869 XEmacs to choose between backward and forward deletion. | |
870 `c-electric-delete-forward' is now bound to C-d to get the | |
871 electric behavior on that key too. | |
872 | |
873 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
874 | |
875 * progmodes/cc-cmds.el (c-fill-paragraph): Fixed bogus direct | |
876 use of c-comment-prefix-regexp, which caused an error when | |
877 it's a list. | |
878 | |
879 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
880 | |
881 * progmodes/cc-mode.el, progmodes/cc-vars.el (c-common-init, | |
882 c-default-style): Removed the hardcoded switch to "java" style | |
883 in Java mode. It's instead taken care of by the default value | |
884 for c-default-style. | |
885 | |
886 2002-04-22 Martin Stjernholm <bug-cc-mode@gnu.org> | |
887 | |
888 * progmodes/cc-align.el (c-lineup-math): Fix bug where lineup | |
889 was triggered by equal signs in string literals. | |
890 | |
1 2002-04-21 Kim F. Storm <storm@cua.dk> | 891 2002-04-21 Kim F. Storm <storm@cua.dk> |
2 | 892 |
3 * subr.el (insert-buffer-substring-no-properties): New function. | 893 * subr.el (insert-buffer-substring-no-properties): New function. |
4 (insert-buffer-substring-as-yank): New function. | 894 (insert-buffer-substring-as-yank): New function. |
5 | 895 |