Using Emacs as an IDE
Currently my workflow with Emacs when I am coding in C or C++ involves three windows. The largest on the right contains the file I am working with. The left is split into two, the bottom being a shell which I use to type in compile or make commands, and the top is often some sort of documentation or README file that I want to consult while I am working. Now I know there are some pretty expert Emacs users out there, and I am curious what other Emacs functionally is useful if the intention is to use it as a complete IDE. Specifically, most IDEs usually fulfill these functions is some form or another:
For a few of these, it's pretty obvious how Emacs can fit these functions, but what about the rest? Also, if a specific language must be focused on, I'd say it should be C++.
Edit: One user pointed out that I should have been more specific when I said 'what about the rest'. Mostly I was curious about efficient version control, as well as documentation lookup. For example, in SLIME it is fairly easy to do a quick hyperspec lookup on a Lisp function. Is there a quick way to look up something in C++ STL documentation (if I forgot the exact syntax of hash_map, for example)?
You'll have to be specific as to what you mean by "the rest". Except for the object inspector (that I"m aware of), emacs does all the above quite easily:
Mx compile
and enter your compile command. From there on, you can just Mx compile
and use the default. Emacs will capture C/C++ compiler errors (works best with GCC) and help you navigate to lines with warnings or errors. Mx gdb
and it will create a gdb buffer with special bindings Edit: I realize my answer about documentation lookup really pertained to code navigation. Here's some more to-the-point info:
Google searching will no doubt reveal further examples.
As the second link shows, looking up functions (and whatever) in other documentation can be done, even if not supported out of the box.
I have to recommend Emacs Code Browser as a more "traditional" IDE style environment for emacs.
EDIT : I also now recommend Magit highly over the standard VCS interface in emacs.
Instead of running a make command in the shell window, have you tried Mx compile? It will run your make command, display errors, and in many cases make it very easy to jump to the line of code that caused the error if the output includes filenames and line numbers.
If you're a fan of IDEs, you might also want to look at emacs' speedbar package (Mx speedbar). And, if you haven't already, learn about how to use tags tables to navigate your code.
链接地址: http://www.djcxy.com/p/62172.html上一篇: 如何在Emacs中实现代码折叠效果?
下一篇: 使用Emacs作为IDE