在Emacs中是否可以显示当前的#ifdef块(例如在模式行中)?
例如:
例如:
#ifdef A
... | #cursor position num. 1
#ifdef !B & C
...
#else /* !B & C */
foo(); | #cursor position num. 2
#endif /* !B & C */
#endif /* A */
如果我将光标放在位置1,则模式行应显示A
,如果我将光标放在位置2,则应显示A & !(!B & C)
。我已经使用了hide-if-def模式,但有时需要处理所有#ifdef块。
C-c C-u
跳转到最近的#ifdef
非常有用。之后,您可以使用C-u C-<SPC>
返回到原来的位置。 - Duncan Jones