1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-22 13:40:44 -08:00
Commit graph

355 commits

Author SHA1 Message Date
Alan Mackenzie
e42a330165 Reverse 2009-12-03T16:02:10Z!acm@muc.de "Enhance `c-parse-state' to run efficiently in
\"brace desserts\".".
2010-04-12 18:58:52 +00:00
Alan Mackenzie
7af4bf3aea Reverse change 2010-02-04T21:15:37Z!acm@muc.de: "Change strategy for marking < and > as template
delimiters: mark them strictly in matching pairs."
2010-04-12 15:15:07 +00:00
Alan Mackenzie
e2387bdba2 Reverse 2010-02-25T21:21:25Z!acm@muc.de:
"  (i) Remove any hard syntax-table properties for <, > inserted by C-y.
  (ii) Remove category text props, not syntax-table ones in unmarking <, >.
".
2010-04-12 14:59:56 +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
Chong Yidong
ffe87109ce * progmodes/cc-mode.el (c-common-init): Bind temporary variables
beg and end before calling c-get-state-before-change-functions.
2010-02-06 08:01:43 -05: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
Glenn Morris
114f9c9679 Add 2010 to copyright years. 2010-01-13 00:35:10 -08: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
a3c11552c6 Revert change 2009-07-18T21:03:43Z!acm@muc.de 2009-12-05 11:16:04 +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
Tassilo Horn
653d15547a 2009-11-20 Tassilo Horn <tassilo@member.fsf.org>
* progmodes/cc-cmds.el (c-update-modeline)
	(c-forward-into-nomenclature, c-backward-into-nomenclature): Refer
	to subword.el functions instead of cc-subword.el.

	* progmodes/cc-mode.el (subword-mode, c-mode-base-map): Refer to
	subword.el functions instead of cc-subword.el.

	* progmodes/cc-subword.el: Renamed to subword.el.
	* subword.el: Renamed from progmodes/cc-subword.el.
	(subword-mode-map): Renamed from c-subword-mode-map.
	(subword-mode): Renamed from c-subword-mode.
	(global-subword-mode): New global minor mode.
	(forward-subword): Renamed from c-forward-subword.
	(backward-subword): Renamed from c-backward-subword.
	(mark-subword): Renamed from c-mark-subword.
	(kill-subword): Renamed from c-kill-subword.
	(backward-kill-subword): Renamed from c-backward-kill-subword.
	(transpose-subwords): Renamed from c-tranpose-subword.
	(downcase-subword): Renamed from c-downcase-subword.
	(capitalize-subword): Renamed from c-capitalize-subword.
	(forward-subword-internal): Renamed from
	c-forward-subword-internal.
	(backward-subword-internal): Renamed from
	c-backward-subword-internal.
2009-11-20 08:22:32 +00:00
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