To whom it may concern,
As an emacs user I have been dealing with the configuration of Semantic to achieve a more agile development. However, the fact that Eigen includes do not have a .h extension makes more difficult to have Emacs parse the library.
Apparently is common practice to add a mode cookie at the beginning of the header file (e.g. the string "-*- C++ -*-" hints emacs to toggle the c++ mode). It is possible also to define local variable at the end of the header file to be used by parsers in general. For example
// Local Variables:
// mode: c++
is there a reason why this useful feature is not present in your headers?
Thank you very much
Is this common practice outside the emacs universe, as well?
I would not entirely object adding some hint to our files but this seems to be very editor specific (and very likely other editors/IDEs want other things, which eventually would make maintaining this a mess).
So generally, I would prefer if there was a local workaround (like telling your emacs that certain files should always be opened as C++).
If someone finds one, it would be nice to add it to our wiki:
hi seems to be mainly an emacs thing. However, also GNU Global has problems parsing the headers without extensions.
On the emacs side I was able to force the c++ mode on eigen's headers using the following code in my init.el
(add-to-list 'auto-mode-alist '("/eigen/Eigen/" . c++-mode) t)
Now semantic parses the header, however I believe that Global does not create the tags.
I'm also rather reluctant about adding such hints, though some of our headers already has some hints for vim:
/* vim: set filetype=cpp et sw=2 ts=2 ai: */
A quick search tells me that many editors have plugins to be compatible with emacs and/or vim modelines, so after all, why not...