diff options
author | Alan Mackenzie <acm@muc.de> | 2017-12-14 17:55:59 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2017-12-14 17:55:59 +0000 |
commit | f838210b018b74b5dd86800aba807c78c921fc3a (patch) | |
tree | 217b3c7d87e26f302926a3fba8fb6e1b6f4437ff /lisp/progmodes/cc-langs.el | |
parent | 232c6465ce789f980da16063a865ac915b060ca4 (diff) | |
download | emacs-f838210b018b74b5dd86800aba807c78c921fc3a.tar.gz emacs-f838210b018b74b5dd86800aba807c78c921fc3a.tar.bz2 emacs-f838210b018b74b5dd86800aba807c78c921fc3a.zip |
Fix misfontification of C++ member initialization list after "throw"
* lisp/progmodes/cc-engine.el (c-forward-type): Stop recognizing a "type"
starting with "throw", by using c-opt-type-modifier-prefix-key.
* lisp/progmodes/cc-langs.el (c-type-modifier-prefix-kwds): New lang const
which, in C++, doesn't contain "throw", otherwise like c-type-modifier-kwds.
(c-opt-type-modifier-prefix-key): New lang const and var, a regexp matching
any keyword in the previous lang const.
Diffstat (limited to 'lisp/progmodes/cc-langs.el')
-rw-r--r-- | lisp/progmodes/cc-langs.el | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 869048bee31..169b61c3dd3 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -1925,16 +1925,32 @@ on one of the `*-decl-kwds' lists." t (c-make-keywords-re t (c-lang-const c-type-prefix-kwds))) (c-lang-defvar c-type-prefix-key (c-lang-const c-type-prefix-key)) -(c-lang-defconst c-type-modifier-kwds - "Type modifier keywords. These can occur almost anywhere in types -but they don't build a type of themselves. Unlike the keywords on -`c-primitive-type-kwds', they are fontified with the keyword face and -not the type face." +(c-lang-defconst c-type-modifier-prefix-kwds + "Type modifier keywords which can appear in front of a type. These can +also occur almost anywhere in types but they don't build a type of +themselves. Unlike the keywords on `c-primitive-type-kwds', they are +fontified with the keyword face and not the type face." t nil c '("const" "restrict" "volatile") - c++ '("const" "noexcept" "volatile" "throw") + c++ '("const" "noexcept" "volatile") objc '("const" "volatile")) +(c-lang-defconst c-opt-type-modifier-prefix-key + ;; Adorned regexp matching `c-type-modifier-prefix-kwds', or nil in + ;; languages without such keywords. + t (and (c-lang-const c-type-modifier-prefix-kwds) + (c-make-keywords-re t (c-lang-const c-type-modifier-prefix-kwds)))) +(c-lang-defvar c-opt-type-modifier-prefix-key + (c-lang-const c-opt-type-modifier-prefix-key)) + +(c-lang-defconst c-type-modifier-kwds + "Type modifier keywords. These can occur almost anywhere in types except +at the start, but they don't build a type of themselves. Unlike the keywords +on `c-primitive-type-kwds', they are fontified with the keyword face and not +the type face." + t (c-lang-const c-type-modifier-prefix-kwds) + c++ (append (c-lang-const c-type-modifier-prefix-kwds) '("throw"))) + (c-lang-defconst c-opt-type-modifier-key ;; Adorned regexp matching `c-type-modifier-kwds', or nil in ;; languages without such keywords. |