1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-18 03:40:47 -08:00
Commit graph

105 commits

Author SHA1 Message Date
Alan Mackenzie
e15f8aaa0e Enhance fontification of declarators to take account of the
presence/absence of "typedef".

cc-engine.el (c-forward-type): New &optional param "brace-block-too".
(c-forward-decl-or-cast-1): cdr of return value now indicates the
presence of either or both of a "struct"-like keyword and "typedef".

cc-fonts.el (c-complex-decl-matchers): Remove the heuristic fontification
of declarators which follow a "}".
(c-font-lock-declarations): Fontify declarators according to the
presence/absence of "typedef".

cc-langs.el (c-typedef-kwds c-typedef-key): New lang variable for
"typedef".
(c-typedef-decl-key): New lang variable built from c-typedef-decl-kwds.
2010-10-09 19:58:28 +00:00
Alan Mackenzie
a4ee83ccd4 (c-forward-<>-arglist-recur): Fix an infinite recursion. 2010-09-15 18:03:25 +00:00
Alan Mackenzie
22c3ce9729 (c-forward-<>-arglist-recur): Correct the indentation. 2010-09-15 17:51:15 +00:00
Chong Yidong
bd78fa1d54 Add "Package:" file headers to denote built-in packages. 2010-08-29 12:17:13 -04:00
Glenn Morris
f3b554af9d Silence some cc-mode compiler warnings.
* lisp/progmodes/cc-engine.el (c-new-BEG, c-new-END)
(c-fontify-recorded-types-and-refs): Define for compiler.
* lisp/progmodes/cc-mode.el (c-new-BEG, c-new-END): Move definitions
before use.
2010-08-16 23:54:03 -07:00
Alan Mackenzie
452ea85502 Enhance Java Mode to handle Java 5.0 (Tiger) and Java 6 (Mustang).
Contributed by Nathaniel Flath.
2010-07-31 20:01:08 +00:00
Alan Mackenzie
43a91810d3 Fix an indentation bug:
progmodes/cc-mode.el (c-common-init): Initialise c-new-BEG/END.
(c-neutralize-syntax-in-and-mark-CPP): c-new-BEG/END: Take account
of existing values.

progmodes/cc-engine.el (c-clear-<-pair-props-if-match-after)
(c-clear->-pair-props-if-match-before): now return t when they've cleared
properties, nil otherwise.
(c-before-change-check-<>-operators): Set c-new-beg/end correctly by
taking account of the existing value.

progmodes/cc-defs.el (c-clear-char-property-with-value-function): Fix
this to clear the property rather than overwriting it with nil.
2010-06-21 21:08:26 +00:00
Alan Mackenzie
c0209c2c68 Fix a bug which happens when doing (c-parse-state) in a CPP construct:
Exclude any "new" CPP construct from taking part in the scanning.
2010-05-21 19:51:48 +00:00
Alan Mackenzie
657071fc07 cc-engine.el (c-remove-stale-state-cache): Fix off-by-one error. Fixes
bug #5747.
2010-03-22 17:21:22 +00:00
Alan Mackenzie
eb2f6eeb39 Correct buggy patch 2010-03-01T11:31:42Z!acm@muc.de to cc-engine.el. 2010-03-01 17:46:36 +00:00
Alan Mackenzie
dd21b6216d Fix bug #5649: 23.1.92; Indentation problems in C mode. 2010-03-01 11:31:42 +00:00
Alan Mackenzie
8a249abc87 (i) Remove any hard syntax-table properties for <, > inserted by C-y.
(ii) Remove category text props, not syntax-table ones in unmarking <, >.
2010-02-25 21:21:25 +00:00
Alan Mackenzie
dd969a56a5 Change strategy for marking < and > as template delimiters: mark them
strictly in matching pairs.
2010-02-04 21:15:37 +00:00
Alan Mackenzie
3e8f7d9196 Fix a situation where deletion of a cpp construct throws an error. 2010-01-21 21:45:01 +00:00
Juanma Barranquero
5a89f0a793 Fix typos in comments. 2010-01-14 19:37:23 +01:00
Glenn Morris
114f9c9679 Add 2010 to copyright years. 2010-01-13 00:35:10 -08:00
Glenn Morris
47641aacc1 (safe-pos-list): Define for compiler. 2009-12-11 01:46:24 +00:00
Alan Mackenzie
d0fcee6698 Fix bug#5091: indentation in c++-mode.
* cc-mode.el (c-basic-common-init): make text property `category' rear
non-sticky.

* cc-engine.el (c-ssb-lit-begin): New defsubst, extracted from ....
(c-syntactic-skip-backward): Refactor, extracting the above.
(c-guess-basic-syntax CASEs 5D.3, 5L): Add extra anchor point;
(c-guess-basic-syntax CASE 19): New CASE to handle template construct
continued over line boundary.
(c-guess-basic-syntax CASE 7): don't trigger on '<'.
2009-12-10 14:29:11 +00:00
Alan Mackenzie
0ec1d2c5bb Enhance `c-parse-state' to run efficiently in "brace desserts".
* progmodes/cc-mode.el (c-basic-common-init): Call
c-state-cache-init.
(c-neutralize-syntax-in-and-mark-CPP):  Renamed from
c-extend-and-neutralize-syntax-in-CPP.  Mark each CPP construct by
placing `category' properties value 'c-cpp-delimiter at its
boundaries.

* progmodes/cc-langs.el (c-before-font-lock-function):
c-extend-and-neutralize-syntax-in-CPP has been renamed
c-neutralize-syntax-in-and-mark-CPP.

* progmodes/cc-fonts.el (c-cpp-matchers): Mark template brackets
with `category' properties now, not `syntax-table' ones.

* progmodes/cc-engine.el (c-syntactic-end-of-macro): A new
enhanced (but slower) version of c-end-of-macro that won't land
inside a literal or on another awkward character.
(c-state-cache-too-far, c-state-cache-start)
(c-state-nonlit-pos-interval, c-state-nonlit-pos-cache)
(c-state-nonlit-pos-cache-limit, c-state-point-min)
(c-state-point-min-lit-type, c-state-point-min-lit-start)
(c-state-min-scan-pos, c-state-brace-pair-desert)
(c-state-old-cpp-beg, c-state-old-cpp-end): New constants and
buffer local variables.
(c-state-literal-at, c-state-lit-beg)
(c-state-cache-non-literal-place, c-state-get-min-scan-pos)
(c-state-mark-point-min-literal, c-state-cache-top-lparen)
(c-state-cache-top-paren, c-state-cache-after-top-paren)
(c-get-cache-scan-pos, c-get-fallback-scan-pos)
(c-state-balance-parens-backwards, c-parse-state-get-strategy)
(c-renarrow-state-cache)
(c-append-lower-brace-pair-to-state-cache)
(c-state-push-any-brace-pair, c-append-to-state-cache)
(c-remove-stale-state-cache)
(c-remove-stale-state-cache-backwards, c-state-cache-init)
(c-invalidate-state-cache-1, c-parse-state-1)
(c-invalidate-state-cache): New defuns/defmacros/defsubsts.
(c-parse-state): Enhanced and refactored.
(c-debug-parse-state): Amended to deal with all the new variables.

* progmodes/cc-defs.el (c-<-as-paren-syntax, c-mark-<-as-paren)
(c->-as-paren-syntax, c-mark->-as-paren, c-unmark-<->-as-paren):
modify to use category text properties rather than syntax-table
ones.
(c-suppress-<->-as-parens, c-restore-<->-as-parens): new defsubsts
to switch off/on the syntactic paren property of C++ template
delimiters using the category property.
(c-with-<->-as-parens-suppressed): Macro to invoke code with
template delims suppressed.
(c-cpp-delimiter, c-set-cpp-delimiters, c-clear-cpp-delimiters):
New constant/macros which apply category properties to the start
and end of preprocessor constructs.
(c-comment-out-cpps, c-uncomment-out-cpps): defsubsts which
"comment out" the syntactic value of characters in preprocessor
constructs.
(c-with-cpps-commented-out)
(c-with-all-but-one-cpps-commented-out): Macros to invoke code
with characters in all or all but one preprocessor constructs
"commented out".
2009-12-03 16:02:10 +00:00
Juanma Barranquero
b4dc7d9888 Fix typos in comments. 2009-10-04 02:11:57 +00:00
Alan Mackenzie
0000ee90eb cc-langs.el (c-nonlabel-token-key): Allow quoted character constants (as
case labels).

cc-engine.el (c-beginning-of-statement-1): Correct buggy bracketing.
2009-09-26 09:18:41 +00:00
Stefan Monnier
efbc652a8f * progmodes/cc-vars.el (c-comment-continuation-stars):
* progmodes/cc-engine.el (c-looking-at-bos):
* progmodes/cc-cmds.el (c-toggle-auto-state)
(c-forward-into-nomenclature, c-backward-into-nomenclature)
(c-comment-line-break-function): Add version of obsolescence.
2009-08-29 02:07:42 +00:00
Alan Mackenzie
d28e7f288e cc-engine.el (c-beginning-of-statement-1): Enhance to parse case clauses
with (compile-time) expressions.
cc-langs.el (c-case-kwds-regexp): New variable for the above.
2009-02-21 16:10:39 +00:00
Glenn Morris
5858f68cd1 Comment (minor header format fixes). 2009-01-11 00:37:05 +00:00
Glenn Morris
ae940284fa Add 2009 to copyright years. 2009-01-05 03:18:22 +00:00
Alan Mackenzie
f412a56770 (c-forward-label): Fix for QT macros. 2008-11-03 19:03:36 +00:00
Alan Mackenzie
a85fd6da69 Amend several doc strings and comments. 2008-10-13 19:12:48 +00:00
Alan Mackenzie
c60f3aa442 (c-guess-basic-syntax CASE 5D.5): Fix an infinite loop on invalid syntax. 2008-06-21 09:00:49 +00:00
Glenn Morris
b1fc2b5014 Switch to recommended form of GPLv3 permissions notice. 2008-05-06 07:25:26 +00:00
Stefan Monnier
cbee283dd7 Fix up comment convention on the arch-tag lines. 2008-04-10 14:10:46 +00:00
Alan Mackenzie
6b6481ed72 (c-in-knr-argdecl): Limit number of paren/bracket pairs parsed, to solve
performance problem.
2008-03-07 22:34:09 +00:00
Miles Bader
b03f96dc5a Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1074
2008-02-24 10:09:07 +00:00
Alan Mackenzie
c8018ede9b Set of changes so that "obtrusive" syntactic elements in a
C/C++/ObjC preprocessor line (e.g. an unbalanced string quote or
unmatched paren) don't interact syntactically with stuff outside
the CPP line.
Comment about text properties amended.
2008-02-19 22:08:55 +00:00
Alan Mackenzie
86f4a763d4 (c-guess-basic-syntax, CASE 5A.5): Anchor the "{" of a template function
correctly on "template", not the following "<".
2008-01-29 20:21:42 +00:00
Alan Mackenzie
820d062bde (c-guess-basic-syntax, CASE 5A.5): Anchor the "{" of a template function
correctly on "template", not the following "<".
2008-01-29 20:17:44 +00:00
Alan Mackenzie
022d0cf4cd Correct typos, enhance comments. 2008-01-27 17:03:43 +00:00
Alan Mackenzie
5da4625816 Correct typos, enhance comments. 2008-01-27 17:02:06 +00:00
Alan Mackenzie
f6558e2d48 Correct typos, enhance comments. 2008-01-27 16:56:04 +00:00
Alan Mackenzie
027d6bb114 (c-guess-basic-syntax): prevent a macro call inside a struct being
recognised as a K&R argument.
2008-01-14 19:23:32 +00:00
Alan Mackenzie
f189315dde (c-guess-basic-syntax): prevent a macro call inside a struct being
recognised as a K&R argument.
2008-01-14 19:17:31 +00:00
Miles Bader
59ce725a3b Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-987
2008-01-08 20:46:54 +00:00
Glenn Morris
4e643dd23c Add 2008 to copyright years. 2008-01-07 02:11:00 +00:00
Juanma Barranquero
1fc0c6247c (c-crosses-statement-barrier-p): Fix typo in docstring. 2007-11-15 18:27:06 +00:00
Juanma Barranquero
b414f37153 (c-crosses-statement-barrier-p): Fix typo in docstring. 2007-11-15 16:41:15 +00:00
Dan Nicolaescu
2f42c75fb0 * progmodes/gud.el (gud-target-name): Move definition before use.
* progmodes/dcl-mode.el: Require imenu at compile time.

* progmodes/cc-engine.el (c-maybe-stale-found-type): Pacify
byte-compiler.

* obsolete/fast-lock.el: Use featurep test instead of
string-match.

* eshell/esh-mode.el (eshell-handle-ansi-color): Require
ansi-color at compile time too.

* eshell/em-unix.el (eshell/info): Require info at compile time
too.

* w32-fns.el: Require w32-vars.

* diff-mode.el (diff-refine-hunk): Require smerge-mode at compile
time too.
2007-10-21 07:33:32 +00:00
Alan Mackenzie
82ba65cfe1 (c-brace-anchor-point): new function.
(c-add-stmt-syntax): Give accurate anchor points for "namespace", "extern"
etc., rather than BOI.  Fix addition of spurious syntactic-symbol
'defun-block-intro, replacing it with 'innamespace, etc.
2007-08-25 17:05:11 +00:00
Alan Mackenzie
a335046bf5 (c-brace-anchor-point): new function. (c-add-stmt-syntax): Give accurate
anchor points for "namespace", "extern" etc., rather than BOI.  Fix
addition of spurious syntactic-symbol 'defun-block-intro, replacing it
with 'innamespace, etc.
2007-08-25 16:50:26 +00:00
Glenn Morris
e7f767c25e Replace `iff' in doc-strings and comments. 2007-08-08 07:34:30 +00:00
Glenn Morris
1a484753b2 Switch license to GPLv3 or later. 2007-07-25 04:29:40 +00:00
Alan Mackenzie
1379f2c583 Fix fontification of labels, and other things with ":".
* progmodes/cc-engine.el (c-forward-label): The function now
returns 'goto-target, 'qt-2kwds-colon, 'qt-1kwd-colon, as well as
the former t.

* progmodes/cc-fonts.el (c-font-lock-declarations): Interpret the
new return code from c-forward-label, fontifying tokens properly.
Add some general comments throughout the file.
2007-04-06 21:21:55 +00:00