[Top][All Lists]

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

Font-lock misfontifies foo::bar in C++

From: Marshall, Simon
Subject: Font-lock misfontifies foo::bar in C++
Date: Thu, 22 Jun 2006 14:33:07 +0100

src/emacs -Q foo.cpp

In the foo.cpp buffer, insert the text:

void foo::bar()  // wrong - foo in font-lock-constant-face (otherwise ok)
  foo                   ;// ok - no fontification
 foo:                    // ok - foo in font-lock-constant-face (also used
for labels)
  foo::         ;// ok - foo not fontified (but maybe could be as a type)
    foo::bar     // wrong - foo in font-lock-constant-face

The text "foo" in "foo::bar" is fontified in font-lock-constant-face, rather
than font-lock-type-face.  In C++, at least, anything before a "::" is a
namespace or class name.  Note that mis-fontification happens when the "b"
of "bar" is typed.

Sorry, no fix.  Cc-fonts.el is too scary for my diminishing elisp skills -
and I'm wary of breaking something else anyway.


In GNU Emacs (sparc-sun-solaris2.8, X toolkit)
 of 2006-06-19 on perth
X server distributor `Hummingbird Ltd.', version 11.0.100015
configured using `configure '--with-x-toolkit=lucid' 'CFLAGS=-g''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: en_GB.ISO8859-1
  value of $LC_CTYPE: en_GB.ISO8859-1
  value of $LC_MESSAGES: C
  value of $LC_MONETARY: en_GB.ISO8859-1
  value of $LC_NUMERIC: en_GB.ISO8859-1
  value of $LC_TIME: en_GB.ISO8859-1
  value of $LANG: en_GB.ISO8859-1
  locale-coding-system: iso-8859-1
  default-enable-multibyte-characters: t

Major mode: C++/l

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t
  abbrev-mode: t

reply via email to

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