]> code.delx.au - gnu-emacs/commit
Apply text properties for <, > in new after-change function (C++ Java Modes).
authorAlan Mackenzie <acm@muc.de>
Mon, 4 Jan 2016 22:29:33 +0000 (22:29 +0000)
committerAlan Mackenzie <acm@muc.de>
Mon, 4 Jan 2016 22:35:13 +0000 (22:35 +0000)
commit33219d385bbb271e2812fef615c81df1983e61d9
tree46cac377e8889942a509348739c3a4e5bb00f118
parent31a97acf43b7eb95f3ddc6ceca1682b35a5b1945
Apply text properties for <, > in new after-change function (C++ Java Modes).

These are category/syntax-table properties to give < and > paren syntax.
Also apply certain `c-type' text properties to the insides of <..> constructs
to ensure that identifiers contained by them get fontified.  This patch fixes
bug #681.

* lisp/progmodes/cc-cmds.el (c-electric-lt-gt): Reformulate due to new
after-change action.

* lisp/progmodes/cc-engine.el (c-before-change-check-<>-operators): Expand
change region to include <s and >s which might not be already marked as
parens, rather than just when paren text properties are removed.
(c-restore-<>-properties): New after-change function, which applies text
properties marking < and > with paren syntax.

* lisp/progmodes/cc-fonts.el (c-font-lock-declarations): Ensure `c-type'
properties are applied to the interiors of <...> constructs, to ensure
fontification of identifiers there.

* lisp/progmodes/cc-langs.el (c-before-font-lock-functions): Add
c-restore-<>-properties to this list for C++ and Java.

* lisp/progmodes/cc-mode.el (c-common-init): When invoking
c-before-font-lock-functions, exclude c-restore-<>-properties from the
functions invoked.
(c-before-change): Initialize c-new-BEG/END here (rather than c-after-change)
to allow modification by before-change functions.
(c-after-change): Amend c-new-END here, rather than initializing it and
c-new-BEG.
lisp/progmodes/cc-cmds.el
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-langs.el
lisp/progmodes/cc-mode.el