开发者

Adding Subdirectories to Load Path

开发者 https://www.devze.com 2023-04-03 04:35 出处:网络
Rather than individually specifing each subdirectory in my plug开发者_运维技巧ins directory I want to be able to automatically load them, to that end I included the following to my .emacs file:

Rather than individually specifing each subdirectory in my plug开发者_运维技巧ins 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

Unfortunately the above results in: File error: Cannot open load file, rinari

Anyone know what's wrong and how to fix it?


You're so close...

(let ((default-directory "~/.emacs.d/plugins/"))
  (normal-top-level-add-subdirs-to-load-path))

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.


You might investigate the role of the subdirs.el files during startup. It is a good way get subdirectories into your load-path.

For example, much of the default load-path arises as a consequence of the files discovered by this command:
find /usr -name subdirs.el

0

精彩评论

暂无评论...
验证码 换一张
取 消