February 7, 2009

cedet + boost::shared_ptr

Eric Ludlam committed to CVS changes, that fix errors in names completion for objects, wrapped into boost::shared_ptr. Now all works fine, and I able to use Emacs more effectively, when I work with foreign code (usually for my code, i remember all functions ;-)
For other smart pointers this feature already existed, the problem was only in parsing of shared_ptr's definition.
P.S. I started to translate to English my introduction level article about Emacs & Cedet usage for work with C & C++ code...

6 comments:

piyo said...

I am looking forward to your article about Emacs & Cedet usage for work with C++ code. I completed a project using C++ and Emacs recently, without the aid of anything more than etags. I can't even remember my own functions. ;-)

Also I was wondering if Cedet works with auto-complete.el?

Which shared_ptr definition? Boost? GNU GCC? Oh oops, the title says "Boost".

Sergey said...

Seems i configured Semantic to work with Boost but anyway it cannot autocomplete shared_ptr. Here is the fragment from my .emacs.el:

;;
(setq boost-base-directory "/home/sergey/programs/boost_1_43_0")

(semantic-add-system-include boost-base-directory 'c++-mode)

;; Preprocessor definitions for BOOST libs
(add-to-list 'semantic-lex-c-preprocessor-symbol-file "/home/sergey/programs/boost_1_43_0/boost/config.hpp")

Alex Ott said...

Hmm, very strange... which include paths are listed in cpp buffer if you execute M-x semantic-describe-buffer ?

Sergey said...

Seems that I fixed this. It has not worked because I haven't added include paths for the types that shared_ptr is wrapping in my project (GStreamer lib) :(.
Next I tried to get normal autocomplete functionality for wxWidgets library. I got it partly working with this method:

http://www.emacswiki.org/emacs/SemanticLibraryParsing#toc3

but after in the semantic list of system includes were added all that stuff: Glib, GStreamer, Boost, wxWidgets includes. Any autocomplete function started to take much time and it became almost useless at this point.
Uhhh it is so cumbersome relative to a tool like Eclipse CDT Suite indexer :( (it is just works almost without any setup :) ). I am quite new to Emacs and until this I always used some IDE (primarily Eclipse and NetBeans) for work and fun.
For now I'm just trying to understand what advantages can Emacs bring to me as a programming enviroment. I'm already about a week playing with Emacs and havent yet found any real advantages that this tool can offer over Eclipse for example.

Alex Ott said...

it's planned to provide more easy setup for CEDET, but not so much people are working on it
For me, the main advantage of Emacs is extensibility

marcotmarcot said...

Do you know a way of making boost::shared_mutex to work? I'm getting Cannot find types for boost::shared_mutex all the times I've tried. I've tried including a lot of files to semantic-lex-c-preprocessor-symbol-file, but it still didn't worked.

Any help is apreciated.