Sorry that I didn't see this earlier. This should only happen in older hide-ifdef-mode in Emacs v24 or earlier. For any Emacs version newer than 25.1 (released 2016/09/17), the aforementioned Hide If Def that I rewrote is built-in and replace the old implementation, which did have the problem of not being able to evaluate preprocessor macros properly. In newer Emacs, you should see something like this by performing C-c @ h
(M-x hide-ifdefs
):
By marking the "ENABLE
" and press C-c @ e
(M-x hif-evaluate-macro
) you can see the value of ENABLE
shown in the echo area.
However, I am not sure why Hide If Def was not working at the time this question was asked (2017/3/22). Before I submitted it into Emacs source trunk (2014/07/07) it has been working for Emacs v24 or even v23. Now I can no longer access Emacs24 or 23 therefore can't reproduce the issue. Anyway, please be sure to try newer (above v25) Emacs.
(By the way, if you really like the texts to be "grayed" out, try C-c @ C-w
(M-x hide-ifdef-toggle-shadowing
), then the hidden texts will really be "grayed" out.)
Hope this helps!
hide-ifdef-mode
having no effect? It certainly works for me. Did you runhide-ifdefs
?M-x hide-ifdefs
You didn't understand Willy's answer.M-x hide-ifdefs
will hide the correct block when I use an integer (ie 1 or 0). But if I wrap that integer into a macro calledENABLE
thenM-x hide-ifdefs
doesn't appear to unwrap the macro. Instead it always hides#if ENABLE
block.