【发布时间】:2014-05-14 16:51:41
【问题描述】:
我正在开发一个项目,其中源代码组织在以下目录结构中:
./source/include
./source/include/analysis
./source/include/tools
./source/include/utils
./source/include/utils/stream
./source/include/utils/string
[...]
./source/src
./source/src/analysis
./source/src/tools
./source/src/utils
./source/src/utils/stream
./source/src/utils/string
[...]
./source/include/(包括./source/include/)的每个子目录都包含头文件。同样./source/src/(包括./source/src/)的每个子目录都包含实现文件。
当在位于“顶级”(即./source/include/ 或./source/src/)的文件上使用ff-find-other-file 时,一切正常。但是我不知道如何配置ff-search-directories 以更深入地搜索并返回目录树。
已经有一个关于 SO (emacs ff-find-other-file and ff-search-directories isn't recursive) 的问题,但它不能解决我的问题,因为这仅适用于静态设置。
理想的解决方案是这样的(伪正则表达式解决方案,其中DIR_REGEXP 匹配所有可能的目录名称):
"../\(DIR_REGEXP\)/include/\1/"
"../\(DIR_REGEXP\)/\(DIR_REGEXP\)/include/\1/\2/"
有没有 elisp sn-p/package 可以提供解决方案?
【问题讨论】: