【问题标题】:emacs open includes in code files, multiple directoriesemacs open 包含在代码文件中,多个目录
【发布时间】:2013-04-11 14:55:12
【问题描述】:

欧洲央行、cscope、xcscope。都在工作。需要cedet吗?

MSVS、eclipse、code::blocks、xcode。所有这些都允许轻松单击包含的源文件并将您带到它。 现在,通过上述设置,emacs 也可以。 除了 emacs 不会将您带到 std:: 库之外,不会假定它们在 /src/linux 或类似位置中的位置。 Emacs 有点盲目,需要你手动设置。

但我找不到任何解释如何设置 ff-find-other-file 以搜索项目目录之外的任何其他目录的内容,更不用说标准的主要库了。

那么,我该怎么做呢?

编辑;最重要的是能够请求文件名(.h、.c、.cpp、.anything)或库(iostream)并打开代码所在的文件。

【问题讨论】:

    标签: c emacs header-files libraries include-path


    【解决方案1】:

    ff-find-other-file 要查看的其他目录位于ff-search-directories 变量中,默认情况下使用cc-search-directories 的值,因此您应该能够自定义两者中的任何一个以指定其他搜索路径。

    关于请求文件名和查找对应文件的第二个问题,类似这样:

    (defun ff-query-find-file (file-name)
      (interactive "sFilename: ")
    
      ;; dirs expansion is borrowed from `ff-find-the-other-file` function    
      (setq dirs
            (if (symbolp ff-search-directories)
                (ff-list-replace-env-vars (symbol-value ff-search-directories))
              (ff-list-replace-env-vars ff-search-directories)))
    
      (ff-get-file dirs file-name))
    

    使用 M-x ff-query-find-file 调用它或将其绑定到您喜欢的键。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多