Emacs Smarter`ff查找其他文件`
我正在从事一个项目,其中源代码组织在以下目录结构中:Emacs Smarter`ff查找其他文件`,emacs,elisp,Emacs,Elisp,我正在从事一个项目,其中源代码组织在以下目录结构中: ./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/u
./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/
)的每个子目录都包含实现文件
使用ff时,在位于“顶层”(即/source/include
/或/source/src/
)的文件上查找其他文件
),一切正常。但是,我不知道如何配置ff搜索目录
,以便更深入地搜索目录树
关于SO()已经有一个问题,但它不能解决我的问题,因为这只适用于静态设置
理想的解决方案是这样的(伪regexp解决方案,其中DIR\u regexp
匹配所有可能的目录名):
“./\(DIR\u REGEXP\)/include/\1/”
“./\(DIR\u REGEXP\)/\(DIR\u REGEXP\)/include/\1/\2/”
是否有任何elisp片段/包可以提供解决方案?评论非常全面,我认为:
M-x查找库RET查找文件RET
ff搜索目录的示例如下:
;; SEARCHING is carried out in a set of directories specified by the
;; ff-search-directories variable:
;;
;; ("." "../../src" "../include/*" "/usr/local/*/src/*" "$PROJECT/src")
;;
;; This means that the corresponding file will be searched for first in
;; the current directory, then in ../../src, then in one of the directories
;; under ../include, and so on. The star is _not_ a general wildcard
;; character: it just indicates that the subdirectories of this directory
;; must each be searched in turn. Environment variables will be expanded in
;; the ff-search-directories variable.
如果这还不够,ff other file list
可以包含函数符号,这些符号可以动态地“返回由相应文件的可能名称组成的列表”。请参阅ff cc hh converter
(在库中定义为参考)的用法。不知怎的,我错过了这个。。。我使用一个/多个通配符使其工作。但是,这可能会增加搜索时间,因为它必须搜索所有子目录。