以下是终端 session 的输出,表明我希望实际设置正确。
~ $cat .emacs
(require 'package)
(custom-set-variables
;;lots of comments generated by computer
'(package-archives (quote(("gnu" . "http://elpa.gnu.org/packages")
("marmalade" . "http://marmalade-repo.org/packages")
("melpa" . "http://melpa.milkbox.net/packages/")
("org" . "http://orgmode.org/elpa")))))
(custom-set-faces
;;again lots of comments added by the computer
)
(add-to-list 'load-path "/usr/share/emacs/24.3/site-lisp/mu4e")
~ $ ls /usr/share/emacs/24.3/site-lisp/mu43
#there are a lot of files here, but I am only going to show 2 right now
mu4e.elc
mu4e.el
...但 emacs M-x mu4e 返回[不匹配]。我已经检查了加载路径变量,它就在那里。我做错了什么?
最佳答案
您还需要添加一件事,以便加载 mu4e
。有两种不同的方法可以做到这一点。
首先,您可以在将路径添加到 load-path
后添加 (require 'mu4e)
。这将立即加载 mu4e
。
或者,您可以添加以下内容:
(autoload 'mu4e "mu4e""启动 mu4e 并显示主窗口"t)
这将告诉 Emacs 延迟加载它(即直到您实际使用它为止)。自动加载已记录here 。 (这基本上是为您通过 package.el
安装的软件包完成的 - 这是相同的机制,您只是不需要自己指定它)。
自动加载的好处是 Emacs 的初始启动速度更快,因为它不是立即加载每个包,而是等到您使用它们为止。
关于emacs 在自己的加载路径中找不到它的东西,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21212542/