突出显示“bool”;在 Java 中使用,在 Emacs 中
在当前的工作中,我在 Java 和 C++ 之间来回切换,因此我倾向于在 Java 中使用“bool”而不是“boolean”。我在 Emacs 中编程,它在声明中与任何其他类型一样突出显示“bool”,因此在编译时我不会捕获错误。
有什么方法可以让 java-mode 为我突出显示“bool”,以便我可以在编写代码时捕获错误?
I switch back and forth between Java and C++ in my current job, and as a result I tend to use 'bool' in Java instead of 'boolean'. I program in Emacs, which highlights 'bool' in a declaration the same as any other type, so I don't tend to catch the error until compile time.
Is there any way to get java-mode to highlight 'bool' for me so that I can catch the error while I'm writing the code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将其添加到您的 .emacs 中:
Add this to your .emacs:
最简单的也许
你也可以将其添加到
java-mode-hook
中。当然,缺点是,此方法不提供语法检查,并且还会在字符串和注释中突出显示......The easiest is perhaps
You can certainly add this to the
java-mode-hook
too. Downside is, of course, this method provides no syntactic checking and will highlight also in strings and comments...