From 0e963201d03d9229bb8ac4323291d2b0119526ed Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 1 Jan 2016 01:16:19 -0800 Subject: Update copyright year to 2016 Run admin/update-copyright. --- lisp/progmodes/cc-langs.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/progmodes/cc-langs.el') diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 1a07c4cd699..8ae75277925 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -1,6 +1,6 @@ ;;; cc-langs.el --- language specific settings for CC Mode -*- coding: utf-8 -*- -;; Copyright (C) 1985, 1987, 1992-2015 Free Software Foundation, Inc. +;; Copyright (C) 1985, 1987, 1992-2016 Free Software Foundation, Inc. ;; Authors: 2002- Alan Mackenzie ;; 1998- Martin Stjernholm -- cgit v1.2.1 From 33219d385bbb271e2812fef615c81df1983e61d9 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Mon, 4 Jan 2016 22:29:33 +0000 Subject: 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 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-langs.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lisp/progmodes/cc-langs.el') diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 8ae75277925..d7972b4ef83 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -499,8 +499,13 @@ parameters \(point-min) and \(point-max).") ;; For documentation see the following c-lang-defvar of the same name. ;; The value here may be a list of functions or a single function. t 'c-change-expand-fl-region - (c c++ objc) '(c-neutralize-syntax-in-and-mark-CPP - c-change-expand-fl-region) + (c objc) '(c-neutralize-syntax-in-and-mark-CPP + c-change-expand-fl-region) + c++ '(c-neutralize-syntax-in-and-mark-CPP + c-restore-<>-properties + c-change-expand-fl-region) + java '(c-restore-<>-properties + c-change-expand-fl-region) awk 'c-awk-extend-and-syntax-tablify-region) (c-lang-defvar c-before-font-lock-functions (let ((fs (c-lang-const c-before-font-lock-functions))) -- cgit v1.2.1 From 73809908c6520208df274dfbdf10e2fa87dc2064 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Tue, 5 Jan 2016 21:16:37 +0000 Subject: Remove function wrongly on AWK Mode value of context fontification hook. * lisp/progmodes/cc-langs.el (c-before-context-fontification-functions): swap order of entries so that awk's entry isn't superseded by the default. * lisp/progmodes/cc-mode.el (c-before-context-fl-expand-region): Correct to handle nil value of c-before-context-fontification-functions. --- lisp/progmodes/cc-langs.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/progmodes/cc-langs.el') diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index d7972b4ef83..08d84fbb625 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -531,8 +531,8 @@ When the mode is initialized, these functions are called with parameters \(point-min), \(point-max) and .") (c-lang-defconst c-before-context-fontification-functions - awk nil - t 'c-context-expand-fl-region) + t 'c-context-expand-fl-region + awk nil) ;; For documentation see the following c-lang-defvar of the same name. ;; The value here may be a list of functions or a single function. (c-lang-defvar c-before-context-fontification-functions -- cgit v1.2.1 From b51f1ef82fa324f08fe94b8fa8aaf8b8ebb3a48e Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Mon, 11 Jan 2016 17:46:04 +0000 Subject: Java Mode: Fontify identifiers in the presence of annotations. * lisp/progmodes/cc-engine.el (c-forward-annotation): Tidy up the coding: Don't move point when the defun fails. (c-forward-decl-or-cast-1): Correct a usage of match data. * lisp/progmodes/cc-fonts.el (c-font-lock-maybe-decl-faces): Remove. (c-font-lock-declarations): Use the new c-maybe-decl-faces in place of the removed variable. * lisp/progmodes/cc-langs.el (c-maybe-decl-faces): New language variable. --- lisp/progmodes/cc-langs.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lisp/progmodes/cc-langs.el') diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 08d84fbb625..b52da3f662d 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -3251,6 +3251,19 @@ way." objc t) (c-lang-defvar c-type-decl-end-used (c-lang-const c-type-decl-end-used)) +(c-lang-defconst c-maybe-decl-faces + "List of faces that might be put at the start of a type when +`c-font-lock-declarations' runs. This must be evaluated (with `eval') at +runtime to get the actual list of faces. This ensures that face name +aliases in Emacs are resolved." + t '(list nil + font-lock-type-face + c-reference-face-name + font-lock-keyword-face) + java (append (c-lang-const c-maybe-decl-faces) + '(font-lock-preprocessor-face))) +(c-lang-defvar c-maybe-decl-faces (c-lang-const c-maybe-decl-faces)) + ;;; Wrap up the `c-lang-defvar' system. -- cgit v1.2.1