emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Font-lock fontifies C/C++ case keyword as a constant


From: Marshall, Simon
Subject: Font-lock fontifies C/C++ case keyword as a constant
Date: Fri, 8 Sep 2006 11:52:42 +0100

In Emacs 19-21 fontifies the following C/C++ snippet:

        case fubar:

so that the keyword "case" is fontified as a keyword and "fubar" is
fontified as a constant.  Seems reasonable.

In Emacs CVS, the keyword "case" is fontified as a constant, and "fubar" is
not fontified at all.

(With the C++ snippet "case foo::bar:" you get the bemusing situation where
everything is fontified as a constant---apart from the constant.  Fontifying
the type/namespace qualifier as a constant is the subject of another bug
report.)

The first bug is that the "case" keyword should not be fontified as a
constant.  

For the second bug, IWBNI the constant was fontified as a constant too, as
it used to be, though that can be awkward where the constant is a constant
expression.  Still, Emacs used to manage to correctly fontify:

        case foo | bar:

so that the keyword "case" is fontified as a keyword and "foo" and "bar" are
fontified as constants.  But if you don't want to fontify constants like
this for some reason, you should make the "default" keyword be fontified as
a keyword too.

Simon.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]