On 11/18/2014 10:01 AM, Óscar Fuentes wrote: > Daniel Colascione writes: > >> On 11/18/2014 08:36 AM, Rüdiger Sonderfeld wrote: >>> On Tuesday 18 November 2014 15:47:43 Óscar Fuentes wrote: >>>> Daniel Colascione writes: >>>>>>> The "alignof" keyword is the only one still missing. >>>>>> >>>>>> From the top of my head: override is also missing. >>>>> >>>>> Because "override" (and "final") are keywords only in certain semantic >>>>> contexts, supporting them requires special care. >>>> >>>> override and final have the same context as `const' for methods, so we >>>> could take that as a model. Skimming over cc-langs.el didn't show an >>>> obvious place for it, though. >>> >>> Yes, but "const" has a meaning in other places as well. That's why it is >>> dealt with in `c-type-modifier-kwds'. I think the problem is similar for >>> "noexcept". I've simply added it to `c-type-modifier-kwds' for now. But it's >>> actually the wrong place. However unlike "override" and "final", there is >>> also an operator version of "noexcept". >> >> C++11 introduced the noexcept and constexpr keywords. They're always >> keywords. "override" and "final" are different. Please don't go hack >> those into cc-engine. Better to leave them unfontified than to fontify >> perfectly good identifiers as keywords. > > Is this the problem? *If* hacking c-mode font-lock system ends with > "override" and "final" fontified as specifiers, is that so terrible? Are > those identifiers so popular? C-mode already gets confused very often > about how to fontify certain non-C-ish chunks of C++ code, so having > "override" and "final" fontified as specifiers everywhere seems a > non-issue to me. What's more annoying is to not fontify them on method > declarations, because my first reaction when glancing at that code is to > assume a typo. Patch cc-engine to recognize the proper context if you care so much. Until you can do that, do not touch cc-mode. >> They're not like "const" at all. > > As far as c-mode is concerned, they are like "certain variety of const." No, lexically, they are completely different. You cannot have a variable called "const". You can have a variable called "final". > If c-mode uses the same heuristics everywhere for fontifying `const', > that means that we cannot exploit the existing mechanism for fontifying > "override" and "final". To bad. Then I would vote for adding them to > some list of keywords. As I said, not having them fontified when they > should is worse than having them fontified when they shouldn't. Do not introduce bugs into Emacs cc-mode. It's one of Emacs most widely used features and will not change to suit your non-universal preferences. If you want to err on the side of over-highlighting, you are free to create a derived mode locally. Do it right or not at all.