4

I don't know if cc-mode or cedet is providing something alike that but that must not be such hard to realize I hope.

What I want is to change background for code in C++ / C# source files between #ifdef (something) and #endif. Is there mode option for make it or where from to start?

cnd
  • 32,616
  • 62
  • 183
  • 313
  • 3
    possible duplicate of [C/C++ mode in Emacs change color of code within #if 0 ... #endif block](http://stackoverflow.com/questions/7189742/c-c-mode-in-emacs-change-color-of-code-within-if-0-endif-block) – Trey Jackson Apr 23 '12 at 13:56

1 Answers1

2

You can use the 'hideif' package which you can enable with:

M-x hide-ifdef-mode

After you enable it, you need to customize hide-ifdef-shadow to be true to indicate coloring instead of invisible text.

If you use CEDET to parse your files, you will gain the added benefit of many of your #define macros being accurate with hideif too.

Eric
  • 3,959
  • 17
  • 15