我希望Emacs在缩进上能像“{”一样处理“#ifdef”,并像“}”一样处理“#endif”。就像这样:
#ifdef __linux__
#include <sys/socket.h>
#endif
int func(void)
{
int foo = 0;
#ifdef DO_STUFF
foo = do_stuff();
#endif
return foo;
}
替换为:
#ifdef __linux__
#include <sys/socket.h>
#endif
int func(void)
{
int foo = 0;
#ifdef DO_STUFF
foo = do_stuff();
#endif
return foo;
}
玩弄“cpp-macro”并不能解决问题。我该怎么做?谢谢!