• Alan Mackenzie's avatar
    Apply text properties for <, > in new after-change function (C++ Java Modes). · 33219d38
    Alan Mackenzie authored
    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
cc-mode.el 76.1 KB