Commit graph

94 commits

Author SHA1 Message Date
Alan Mackenzie
c82f92a0fd (c-before-hack-hook, c-postprocess-file-styles): Give invocation of
`c-set-style' DONT-OVERRIDE parameter of t.  Already set style variables will
thus not be overridden by style settings given by `c-file-syle'.
2009-07-18 20:42:55 +00:00
Alan Mackenzie
a0526d5ee5 cc-mode.el (c-extend-and-neutralize-CPP-line): Renamed from
c-neutralize-syntax-in-CPP.  Set the variables c-new-BEG and c-new-END,
thus extending the font-lock region.
(c-font-lock-init): Don't set obsolete variable font-lock-lines-before.

cc-langs.el (c-before-font-lock-function): Rename a value to
c-extend-and-neutralize-syntax-in-CPP.
2009-05-19 22:35:07 +00:00
Alan Mackenzie
38477befdc # Fix a typo. 2009-01-30 21:24:22 +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
Chong Yidong
a36abf0ef3 (c-before-hack-hook): New function
(Top Level): Install c-before-hack-hook on
before-hack-local-variables-hook, rather than
c-postprocess-file-styles on hack-local-variables-hook.
2008-07-31 01:37:35 +00:00
Dan Nicolaescu
f63b48bb47 (auto-mode-alist): Add .i and .ii files. 2008-07-24 02:55:59 +00:00
Alan Mackenzie
13ac2398ff cc-mode.el (c-mode-base-map): Don't bind C-M-[ae] to the CC Mode specific
functions; this is no longer needed, since {beginning,end}-of-defun now
pass ARG to ...-of-defun-function.

cc-defs.el (c-emacs-features): new feature 'argumentative-bod-function.

----------------------------------------------------------------------
cc-defs.el cc-mode.el CVS:
----------------------------------------------------------------------
2008-06-27 21:12:46 +00:00
Stefan Monnier
b705155a62 (c-make-inherited-keymap): Only use set-keymap-parents if set-keymap-parent
doesn't exist.
2008-06-20 19:52:37 +00:00
Miles Bader
142e26a72e Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1179
2008-05-26 06:57:40 +00:00
Alan Mackenzie
c5fcadd11f (c-postprocess-file-styles): Throw an error if c-file-style is set to a
non-string.

(c-neutralize-CPP-line): Surround by `save-excursion'.
(c-neutralize-syntax-in-CPP): Optimize for speed.
2008-05-24 12:47:37 +00:00
Alan Mackenzie
b9a6ed295c * progmodes/cc-mode.el (c-postprocess-file-styles): Throw an error
if c-file-style is set to a non-string

(c-neutralize-CPP-line): Surround by `save-excursion'.
(c-neutralize-syntax-in-CPP): Optimize for speed.
2008-05-24 12:31:59 +00:00
Glenn Morris
ae500c1a0f (declare-function): Add compat definition.
(awk-mode-syntax-table, c-awk-unstick-NL-prop): Declare for compiler.
2008-05-15 03:30:40 +00:00
Glenn Morris
b1fc2b5014 Switch to recommended form of GPLv3 permissions notice. 2008-05-06 07:25:26 +00:00
Miles Bader
a113b3ca32 Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1121
2008-04-23 05:55:42 +00:00
Stefan Monnier
cbee283dd7 Fix up comment convention on the arch-tag lines. 2008-04-10 14:10:46 +00:00
Stefan Monnier
7d56274281 (c-basic-common-init): Don't set
font-lock-extend-after-change-region-function globally.
2008-04-08 15:27:49 +00:00
Alan Mackenzie
8714fc1869 (c-basic-common-init): Set font-lock-extend-after-change-region-function.
(c-extend-after-change-region): New function, used in
font-lock-extend-after-change-region-function, thus superseding advice on
the Font Lock after change functions.
(c-advise-fl-for-region): Remove this macro.
2008-04-06 21:13:11 +00:00
Alan Mackenzie
afd2c2fc74 (c-extend-after-change-region): New function, used in
font-lock-extend-after-change-region-function, thus superseding advice on
the Font Lock after change functions.
2008-04-06 20:33:05 +00:00
Alan Mackenzie
f18ea992ca (c-neutralize-syntax-in-CPP): Fix coding bug. 2008-03-04 22:15:39 +00:00
Alan Mackenzie
0ce2ec82c9 (c-neutralize-syntax-in-CPP): Fix coding bug. 2008-03-01 09:05:12 +00:00
Miles Bader
51fb064bc7 Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1090
2008-03-01 01:28:31 +00:00
Alan Mackenzie
d70e242245 (c-neutralize-syntax-in-CPP): Fix a bug on typing "#" at EOB. 2008-02-25 21:15:50 +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
f8016ed60d (c-extend-region-for-CPP): always set c-old-EOM. 2008-02-20 22:18:28 +00:00
Alan Mackenzie
1d1e48680d 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.
(c-basic-common-init): C and ObjC now use syntax-table text properties.
(c-common-init): Call language specific before/after-change functions at
mode initialisation.
(c-new-BEG, c-new-END, c-old-BOM, c-old-EOM): new variables.
(c-extend-region-for-CPP, c-neutralize-CPP-line,
c-neutralize-syntax-in-CPP): new functions.
(c-before-change, c-after-change): call the new language specific change
functions defined in cc-langs.el.
(c-advise-fl-for-region): new macro.
(awk-mode): Remove AWK specific stuff which has been refactored into
language independent stuff.
2008-02-19 22:14:40 +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
Thien-Thi Nguyen
d2f795854e * progmodes/cc-vars.el (defcustom-c-stylevar): Eval VAL.
(c-comment-continuation-stars): No longer declare with
cc-bytecomp-obsolete-var and cc-bytecomp-defvar.
(c-block-comment-prefix): Use symbol-value to
access c-comment-continuation-stars.
* progmodes/cc-mode.el (c-initialize-cc-mode):
Use symbol-value to access c-comment-continuation-stars.
2007-12-18 09:21:28 +00:00
Glenn Morris
d61ca8d5cc (c-postprocess-file-styles)
(c-submit-bug-report): Use mapc rather than mapcar.
2007-10-12 03:03:25 +00:00
Dan Nicolaescu
17ee46255f * progmodes/cc-mode.el (c-mode-base-map): Use
c-indent-line-or-region instead of c-indent-line.

* indent.el (indent-for-tab-command): First check if the region is
active.
2007-09-24 17:48:50 +00:00
Alan Mackenzie
3d38de912c Fix problem with modes derived from CC Mode: Move macro
`c-make-emacs-variables-local' from cc-mode.el to cc-langs.el.  Call it
from c-make-init-lang-vars-fun (cc-langs.el) instead of
c-init-language-vars-for (cc-mode.el).
2007-07-28 11:51:38 +00:00
Alan Mackenzie
473944f358 Fix problem with modes derived from CC Mode: Move macro
`c-make-emacs-variables-local' from cc-mode.el to cc-langs.el.  Call it
from c-make-init-lang-vars-fun (cc-langs.el) instead of
c-init-language-vars-for (cc-mode.el).
2007-07-28 11:45:55 +00:00
Glenn Morris
1a484753b2 Switch license to GPLv3 or later. 2007-07-25 04:29:40 +00:00
Alan Mackenzie
5c4c911a17 (c-remove-any-local-eval-or-mode-variables): When removing lines, also
remove the \n.  Correction of patch of 2007-04-21.
2007-06-20 08:27:53 +00:00
Glenn Morris
46ff758022 Stefan Monnier <monnier at iro.umontreal.ca>
(c-before-change): Use point-min rather than 1.
2007-04-28 20:39:11 +00:00
Martin Rudalics
33a9c08c34 (c-remove-any-local-eval-or-mode-variables): Use delete-region
instead of kill-line.
2007-04-21 22:00:45 +00:00
Alan Mackenzie
6bc7293bd6 (c-before-change): Fix BOB bug. 2007-03-25 12:03:13 +00:00
David Kastrup
7a147065e4 (c-make-emacs-variables-local): Use
`mapcar' rather than `mapcan' to silence compiler warning.
2007-03-23 09:52:42 +00:00
Alan Mackenzie
d4e5bf0f80 (c-before-change): insert call of `save-match-data'. 2007-03-09 23:11:15 +00:00
Alan Mackenzie
9c184ed25c (c-unfind-enclosing-token, c-unfind-coalesced-tokens, c-before-change): new
functions;
(c-maybe-stale-found-type): new variable.
An ad hoc attempt to remove stale tokens from the cache `c-found-types'.
2007-03-08 21:50:51 +00:00
Glenn Morris
d7a0267c8d Add 2007 to copyright years. 2007-01-21 03:53:13 +00:00
Alan Mackenzie
51c9af45fe Update CC Mode to version 5.31.4. The detailed changes are those
recorded in the ChangeLog for 2007-01-01.
2007-01-01 22:11:28 +00:00
Alan Mackenzie
99c8496ec5 (c-basic-common-init): don't set open-paren-in-column-0-is-defun-start to
nil any more.
2006-12-17 22:15:46 +00:00
Glenn Morris
92ab38343d Fix Copyright format. 2006-12-03 01:00:52 +00:00
Alan Mackenzie
26b8f810d0 * progmodes/cc-langs.el (c-emacs-variable-inits): new variable.
(c-lang-setvar): new macro.
(c-make-init-lang-vars-fun): Use the initialization forms in
c-emacs-variable-inits in addition to those in c-lang-variable-inits.
(comment-start, comment-end, comment-start-skip): Change these from
c-lang-defvar's to c-lang-setvar's.

* progmodes/cc-mode.el (c-make-emacs-variables-local): new macro,
which calls make-local-variable on the elements of
c-emacs-variable-inits.
(c-init-language-vars-for): Call this new macro.
2006-07-20 09:48:09 +00:00
Alan Mackenzie
3c0ab532f8 * progmodes/cc-awk.el, cc-defs.el, cc-fonts.el, cc-langs.el,
cc-mode.el: Changes to eradicate eval-after-load.
2006-07-10 13:19:14 +00:00
Alan Mackenzie
cb694ab730 cc-align.el, cc-awk.el, cc-bytecomp.el, cc-cmds.el, cc-compat.el,
cc-defs.el, cc-engine.el, cc-fonts.el, cc-langs.el, cc-menus.el,
cc-mode.el, cc-styles.el, cc-subword.el, cc-vars.el:  Add 2006 to the
copyright statement.

cc-awk.el: (c-awk-after-change): Protect the match data with
save-match-data.  It was being corrupted when Font Lock was not enabled.
(ii): Fix a typo.

cc-cmds.el, cc-mode.el, cc-engine.el (c-update-modeline): Concatenate the
minor mode indicators directly onto mode-name, removing
c-submode-indicators.  Sometimes, c-s-i got separated from the mode name
on the mode line.

cc-cmds.el, cc-mode.el: Rename c-hungry-backspace to
c-hungry-delete-backwards, at the request of RMS.  Leave the old name as
an alias.

cc-cmds.el (c-electric-brace, c-electric-semi&comma, c-electric-colon):
Correct doc-strings: "/ln" -> "/la".

cc-cmds.el (c-electric-brace): Fix clean-up brace-else-brace (error due
to mbeg, mend being undefined).

cc-defs.el (c-version): Update to 5.31.3.

cc-defs.el: [Supersedes patch V1.38]: (top level): Check for a buggy
font-lock-compile-keywords ONLY in XEmacs.  GNU Emacs 22 now has a check
which would throw an error here.

cc-engine.el (c-beginning-of-statement-1): Clarify doc-string and
comments.  Distinguish real labels ("case 1:" or "foo:") from non-labels
("public:").

cc-engine.el (c-after-change-check-<>-operators): Remove save-match-data,
reversing change for V1.45.  save-match-data is now in c-after-change.

cc-engine.el (c-forward-objc-directive): Replace c-forward-token-2 with
crude coding; c-f-t-2 doesn't move over a token at EOB.  Objc Mode was
hanging after typing, e.g., "@implementation".

cc-langs.el (c-filter-ops): Made it available at runtime too to work when
`c-make-init-lang-vars-fun' needs to evaluate from source.

cc-langs.el (c-make-init-lang-vars-fun): Improved the error message when
there's an evaluation error to show whether it's loaded from source or
not.
(c-mode-menu): Add menu items for Electric Mode and Subword Mode.

cc-mode.el (c-after-change): Protect the match data with save-match-data.
It was getting corrupted by c-after-change-check-<>-operators.

cc-mode.el: File Local variables: Solve the problem where both `mode' and
c-file-offsets are specified: `mode' will overwrite c-f-o's settings:
(c-remove-any-local-eval-or-mode-variables): new function.
(c-postprocess-file-styles): call the above new function, within
c-tentative-buffer-change, to splat `mode' and `eval' before the second
hack-local-variables.
2006-02-24 15:33:02 +00:00
Nick Roberts
d91362c9e0 Update copyright for 2006. 2006-02-10 09:00:31 +00:00
Alan Mackenzie
0386b551af Update CC Mode to release 5.31. 2005-12-02 12:30:36 +00:00