3 ms·
While it's good to see the work you put into this article, for the emacs novice it really is far too much of an information dump, in particular it's a little di
by CJefferson 12y ago
While it's good to see the work you put into this article, for the emacs novice it really is far too much of an information dump, in particular it's a little difficult to keep track of all the different things which do the same thing.
Perhaps if you change it in future, think about having a 'basic config' which one can follow?
It would also be nice to know how well these things cope with things like templates and C++11 rvalue references and lambda functions. My past experience is that tags-based tools are fine when your C++ code is basically just C code, but die horribly as soon as you start using C++11 or boost.
- tuhdo 12y agoI think it's pretty basic. I created a demo repo for people to play with, so they don't have to configure themselves: https://github.com/tuhdo/emacs-c-ide-demo https://github.com/tuhdo/emacs-c-ide-demo For C++, CEDET works pretty nicely with templates and libraries like Boost. I haven't used much C++ aside playing with lambda, so I'm not sure. I've looked at rvalue reference, and it seems to return an assignable pointer to do other thing from a function. Currently, you can jump to the function but not the pointer that the function returns. Currently, I only work with C. But being able to jump anywhere in the Linux kernel source tree and your system include source (such as "/usr/include", "/usr/local/include" is already very useful, don't you agree?
- stinos 12y agoI've looked at rvalue reference, and it seems to return an assignable pointer to do other thing from a function I'm not sure how you came to that conclusion, but it is not correct. R-values don't have much to do with pointers at all. Though they sometimes do solve problems you would be tempted to use pointers for. I admit I do find it hard to explain briefly what they are though. Maybe these are helpful, though it might be hard to grasp if you don't already properly understand C++: http://www.artima.com/cppsource/rvalue.html http://www.artima.com/cppsource/rvalue.html http://thbecker.net/articles/rvalue_references/section_01.html http://thbecker.net/articles/rvalue_references/section_01.ht.... This example basically gives an idea of why they are useful: http://thisthread.blogspot.be/2011/03/what-is-rvalue-reference-good-for.html http://thisthread.blogspot.be/2011/03/what-is-rvalue-referen...
- tuhdo 12y agoWell currently I only work with C not C++ anymore so my knowledge might be outdated. I thought that the rvalue reference is something new in C++11, as I read it here: http://thbecker.net/articles/rvalue_references/section_01.html http://thbecker.net/articles/rvalue_references/section_01.ht.... Your article seems to mention different thing from 2008? In the article I read, a function returns a pointer that you can assign it like this: get_pointer() = 1;
- stinos 12y agoThe design of C++11 started way before 2011, hence articles from 2008. get_pointer() = 1; assigning 1 to a pointer isn't the best idea :P so I think you mean you read int& get_reference(); get_reference() = 1; which is about lvalue references, not rvalue references, and has existed in C++ since the beginning.
- tuhdo 12y agoThanks for the explanation.
- mandor 12y agoI agree: this is not C/C++ IDE, this is a C IDE (and maybe a "C-with-classes" IDE). None of these emacs packages (e.g. CEDET) handle modern C++ well (heavy use of generic programming, boost, c++-11 features, etc.). Even indenting this code is complicated for an editor! I think the only way to do it is to rely on the compilers to parse the code. Clang has a nice API (and command lines tools) for this. For instance, there are some packages for auto-completition in emacs: http://www.emacswiki.org/emacs/AutoComplete http://www.emacswiki.org/emacs/AutoComplete Last, it would be nice to have a brew/ubuntu package so we can easily install the "IDE" :)
- tuhdo 12y agoAutoComplete has nothing to do with C/C++. It's just a package for displaying completion candidates, but you must give it a source for displaying. It is pretty outdated compare to company-complete. Company also has a Clang[ backend, available through the command company-clang. Emacs also has Clang based solutions such as rtags: https://github.com/Andersbakken/rtags https://github.com/Andersbakken/rtags that can index code as you type but is complicated to setup. Or you can use Clang to generate a tag database for your source code with clang-ctags: https://github.com/drothlis/clang-ctags https://github.com/drothlis/clang-ctags , but the performance for creating tag database is not so good for large source tree: it took "98 minutes and a peak memory usage of 140MB" to generate a tag database for entire LLVM source. As for CEDET, in what way it could not handle library like Boost? Could you be specific? I tried it before with Boost, and it works pretty well (i.e. gives correct completion candidates in a namespace). I used CEDET for getting completion candidates all the time in Boost.
- deng 12y agoRegarding the C++ parser, here's the current state: It does not support any C++11. Especially 'auto' is problematic, since type inference is quite a hard problem. Basic templates are handled, but things like template specialization or default template parameters still break things. I'm currently working on fixing this; it's been in my personal branch for quite some time now, but I haven't got around to merge it into mainline. Actually, still one of the most problematic things is preprocessor handling. If the parser doesn't work, it is often due to some preprocessor macros Semantic does not know about.
- signa11 12y agothere is always the clang-completion-mode which uses clang/llvm infratructure for more comprehensive emacs integration...