我想使用 cedet 在我的程序中导航。我使用 semantic-ia-fast-jump 跳转到声明,使用 semantic-analyze-proto-impl-toggle 跳转到实现。我发现这两个命令需要同一目录中的文件。所以我需要将所有目录添加到搜索路径中。我指的是一个来自互联网的人。代码如下:
(setq semanticdb-project-roots (list (expand-file-name "~/")))
(defconst cedet-user-include-dirs
(list "~/samuel/project/modules/MManage/inc"
"~/samuel/project/modules/MManage/src"
...
))
(require 'semantic-c nil 'noerror)
(let ((include-dirs cedet-user-include-dirs))
(mapc (lambda (dir)
(semantic-add-system-include dir 'c++-mode)
(semantic-add-system-include dir 'c-mode))
include-dirs))
我有几个模块,所以我需要添加很多目录。它不方便也不便携。我认为这一定是一个很好的配置方法。
PS:引用http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html#sec6
我的设置如下
(ede-cpp-root-project "library_samuel"
:name "library_samuel project"
:file (expand-file-name "~/samuel/project_self/library_samuel/CMakeLists.txt")
:include-path '("/common/include" "/modules/MManage/inc" "/modules/ImageProcess/inc" )
:spp-table '(("BUILD_APP" . "")))
semantic-ia-fast-jump 可以很好地工作,但 semantic-analyze-proto-impl-toggle 不能工作。看来头文件和源文件必须在同一目录中。如何解决这个问题。
最佳答案
最好设置项目(例如,查看 my article on CEDET )。在项目内部,您可以使用 include-path
指令引用相对路径
关于emacs - 导航上的路径配置 By cedet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11879449/