From 7f0789c9db1b26329e22157479d449d29ea50d34 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Tue, 19 Oct 2010 20:45:42 +0000 Subject: [PATCH] cc-langs.el (c-type-decl-prefix-key): C++ bit: move "\(const\|throw\|volatile\)\>" nearer the start of the regexp, so that these keywords aren't wrongly matched as identifiers. --- lisp/ChangeLog | 4 ++++ lisp/progmodes/cc-langs.el | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4aa0ead72b4..58d7841dfd8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2010-10-19 Alan Mackenzie + * progmodes/cc-langs.el (c-type-decl-prefix-key): C++ bit: move + "\(const\|throw\|volatile\)\>" nearer the start of the regexp, so + that these keywords aren't wrongly matched as identifiers. + * progmodes/cc-mode.el (c-before-change, c-after-change): Move the setting of c-new-BEG and c-new-END from c-before-change to c-after-change. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index ba056133651..ad6b6787652 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -2676,15 +2676,15 @@ Identifier syntax is in effect when this is matched \(see c++ (concat "\\(" "[*\(&]" "\\|" - (concat "\\(" ; 2 + (c-lang-const c-type-decl-prefix-key) + "\\|" + (concat "\\(" ; 3 ;; If this matches there's special treatment in ;; `c-font-lock-declarators' and ;; `c-font-lock-declarations' that check for a ;; complete name followed by ":: *". (c-lang-const c-identifier-start) "\\)") - "\\|" - (c-lang-const c-type-decl-prefix-key) "\\)" "\\([^=]\\|$\\)") pike "\\(\\*\\)\\([^=]\\|$\\)") -- 2.39.2