3

I'm relatively new to Emacs and I have recently set it up as an IDE to develop C++ (emacs24 + builtin CEDET + ECB from cvs). I am enjoying the results so far but I'd like some custom highlighting which doesn't seem to exist by default.

When I declare a new constant, local variable or object attribute they appear in a different color. However, when they are used somewhere else, they are displayed as normal text. I'd like to make the constants to be displayed in another color + italics (for example) when they are used somewhere in the code after being declared.

Is there any way to achieve that? I have tried to C-u C-x = to see the enabled faces and customize them, but it doesn't seem to notice that I'm over a special symbol and not ordinary text. ECB displays them as variables or attributes in one of its windows.

N.N.
  • 8,336
  • 12
  • 54
  • 94
pparescasellas
  • 620
  • 1
  • 12
  • 23

1 Answers1

1

When you declare a variable, the coloring is done with font-lock, and is related to the syntax of the declaration. Uses of a variable or function are indistinct and can't really be identified.

If you are referring to the Senator menu item that lets you color a tag in some way, that only colors that tag. It doesn't know how to track the occurances down. To track occurances, you need to use semantic-symref or similar tool, probably with a more advanced back-end like GNU Global.

There is a useful mode you can enable with semantic-idle-local-symbol-highlight that will do special highlighting for the symbol you are on, but it doesn't really match what you are looking for.

Eric
  • 3,959
  • 17
  • 15
  • So it's not easy to use a different face for all the symbols that are considered local variables, object members, etc. I just thought that highlighting all the object members (like Eclipse does, for example) would be a nice feature to have, but I can live without it. I am already using `semantic-idle-local-symbol-highlight`; thanks for your answer :) – pparescasellas Feb 24 '12 at 11:42