Emacs symbol-at-point with C++ scope
Has anyone extended symbol-at-point
to include, in my use case the C++开发者_如何学C namespace, scope as well?
Having the cursor on std::vector
should preferably return ("std" "vector")
.
The CEDET
toolset includes a set of local context parsers that will do what you want, but it doesn't extend symbol-at-point
. Instead it has its own context parser. If you have a version of Emacs with CEDET pre-installed, just enabled semantic-mode
, and then use the command semantic-analyze-current-context
. It will return a class with the prefix. If you just want the raw prefix for a program, then you can instead use semantic-ctxt-current-symbol
to return whatever is under point.
精彩评论