Take the 2-minute tour ×

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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer


