我已经在Emacs中使用elpa安装了一些包,但是在启动Emacs时如何加载它们呢?
发布于 2014-04-26 12:55:43
package-install是package.el的一部分,您可以在describe-function中看到这一点。来自package.el文档:
;; At activation time we will set up the load-path and the info path,
;; and we will load the package's autoloads. If a package's
;; dependencies are not available, we will not activate that package.所以在每个包中都有一个文件
NAME-autoloads.el此文件在启动时加载。
整个包都包含在package-user-dir下
(setq package-user-dir "~/.emacs.d/site-lisp/package-install")
(require 'package)每个包还包含带有包版本和描述的NAME-pkg.el。例如,以下是与tabbar包相关的文件:
package-install # that's my package-user-dir
└── tabbar-2.0.1 # each package dir is in the separate dir
├── tabbar-autoloads.el # this file is loaded at start up
├── tabbar.el # the package itself. In this case it is just a single file
└── tabbar-pkg.el # information about the package for package managment引用手册的话:39.1.1 Summary: Sequence of Actions at Startup
Emacs package -enable-at-
过的Emacs Lisp包
然后,package-initialize调用package-activate,后者调用package-activate-1,后者以加载NAME-autoload.el结束
(load (expand-file-name (concat name "-autoloads") pkg-dir) nil t)https://stackoverflow.com/questions/23306091
复制相似问题