emacs、etags 以及使用 emacs 作为 IDE
我常用的工具是 Linux 系统上带有 g++ 的 Emacs,用于实现我的研究算法。在过去的几年里,我以相当基本的方式使用 emacs。我打开 C 或 C++ 文件,使用我选择的语法突出显示方案编辑它们,然后在 emacs 中(或者可能从终端)进行编译和执行其他操作,包括在 emacs 中使用 gdb 进行调试。我了解 etags 和 ctags,并且使用过 etags 和 emacs,但似乎没有找到这些工具的“最佳位置”。
我想知道,其他人如何配置 emacs,使其与 etag 和其他工具很好地配合?需要对 emacs 进行哪些调整才能使其成为更好的 IDE?
My usual tools are Emacs with g++ on a Linux system to implement my research algorithms. For the last some years, I have used emacs in a fairly basic way. I open C or C++ files, edit them with a syntax highlighting scheme of my choice and compile and do other stuff from within emacs (or maybe from a terminal), including using gdb within emacs for debugging. I know about etags and ctags and have played a bit with etags and emacs but don't seem to find that "sweet spot" with the tools.
I was wondering, what do others do to configure emacs just so that it meshes nicely with etags and other tools? What tweaks does one need to do to emacs to make it a better IDE?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于仅标记信息,我还推荐 GNU Global。 CScope 还可以做很多事情。在这两种情况下,它们都提供了一种通过名称查找标签位置以及特定标签的用途的方法。
对于“IDE Stuff”来说,它不仅仅是一个标签系统。为此,我推荐 Emacs 的 CEDET 工具集。这提供了一个项目管理系统(EDE),它可以创建 Makefile 来为您编译代码。还有一个解析和代码分析部分(语义),提供智能补全。有一个模板/代码生成系统(SRecode),可以将标签从语义转换回代码。甚至还有一个 UML 图编辑器 (COGRE),它可以从您在 Emacs 中绘制的类图生成代码。
大多数使用CEDET的人只使用解析器和智能补全系统,可能与ECB结合使用,使用就可以了只是 CEDET 的一个子集。
为了更好地衡量,CEDET 还将与 GNU Global 数据库集成,这样除了标记位置之外,您还可以参考符号使用以及 Emacs 的常规 GNU Global 界面。
For just tagging info, I also recommend GNU Global. CScope can do a lot also. In both cases, they provide a way to find the location of a tag by name, and also the uses of a particular tag.
For "IDE Stuff" there is more to it than just a tagging system. For that, I recommend the CEDET set of tools for Emacs. This provides a project management system (EDE) which can create Makefiles to compile your code for you. There is also a parsing and code analysis part (Semantic) which provides smart completion. There is a template / code generation system (SRecode) which can convert tags from semantic back into code. There is even a UML diagram editor (COGRE) which can generate code from a class diagram that you draw in Emacs.
Most people using CEDET only use the parser and smart completion systems, possibly in combination with ECB, and it is ok to use only a subset of CEDET.
For good measure CEDET will also integrate with GNU Global databases so you can reference symbol uses in addition to tag locations along with the regular GNU Global interface for Emacs.
我们最近开始使用 GNU Global 作为 etag 的替代品,我一直在印象很深刻。我们还使用 idutils 它提供了一种快速搜索源代码中任何字符串的方法。
We've recently started using GNU Global as a replacement for etags, and I've been pretty impressed. We also use idutils which provides a fast way to search for any strings in the source code.