这个问题类似于一个。
但是,将所有可实现的子目录也放入文件夹中是不同的。
Jouni 的代码可以实现第一级文件夹
(let ((base "~/Projects/emacs"))
(add-to-list 'load-path base)
(dolist (f (directory-files base))
(let ((name (concat base "/" f)))
(when (and (file-directory-p name)
(not (equal f ".."))
(not (equal f ".")))
(add-to-list 'load-path name)))))
如何在 Emacs 中将目录及其所有子目录放入 load-path?