emacs ff-find-other-file and ff-search-directories isn't recursive

折月煮酒 提交于 2019-12-04 13:06:35

I've added this function to my .emacs file:

(defun get-all-subdirectories(dir-list)
  "Returns a list of all recursive subdirectories of dir-list, 
   ignoring directories with names that start with . (dot)"
  (split-string 
   (shell-command-to-string 
     (concat "find " 
             (mapconcat 'identity dir-list " ")
             " -type d -not -regex \".*/\\\..*\""))))

And, in my c-mode-common-hook, I have this:

(setq ff-search-directories (get-all-subdirectories (list "dirA" "dirB")))

This assumes you have a standard Unix find command in your PATH. If you're on Windows, you can get a copy of find here: http://unxutils.sourceforge.net/

It takes a little while to run if you have many directories for it to recurse through.

Add a /* after the directories where you want subdirectories searched. So set ff-search-directories so that it contains "/usr/include/*".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!