添加子目录加载路径 [英] Adding Subdirectories to Load Path
本文介绍了添加子目录加载路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
而不是单独指定我的plugins目录中的每个子目录,我希望能够自动加载它们,为此,我将以下内容添加到.emacs文件中:
Rather than individually specifing each subdirectory in my plugins directory I want to be able to automatically load them, to that end I included the following to my .emacs file:
(let ((base "~/.emacs.d/plugins/"))
(normal-top-level-add-subdirs-to-load-path))
require 'rinari
require 'yasnippet
不幸的是上面结果:文件错误:无法打开加载文件,rinari
任何人都知道有什么问题,如何解决?
Anyone know what's wrong and how to fix it?
推荐答案
你很接近...
(let ((default-directory "~/.emacs.d/plugins/"))
(normal-top-level-add-subdirs-to-load-path))
normal-top-level-add-subdirs-to-load-path
可以通过变量 default-directory
而不是 base
像你试过的那样。
normal-top-level-add-subdirs-to-load-path
works off the current directory, which you can set via the variable default-directory
- not base
like you tried.
这篇关于添加子目录加载路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文