我现在正在尽可能通过 MELPA 和 Marmalade 安装插件,同时使用 git 管理我的 ~/.emacs.d。但是,我已经将 *.elc 文件添加到了 git 的忽略列表中。
这意味着当我在一个系统上安装一个插件,然后开始在另一个系统上使用时,git pull
命令只会拉取 *.el 文件。然而,使用这些文件往往比使用 *.elc 文件要慢。
我尝试将以下内容添加到 ~/.emacs.d/init.el 文件中:
;; load the packages we've installed. Note that package-install
;; byte-compiles the packages, but .elc is ignored by git so we force recompilation here
(byte-recompile-directory (expand-file-name "~/.emacs.d/elpa") 0)
(package-initialize)
很遗憾,这与package.el所做的编译不相等。例如,如果我安装了emacs-eclim,package.el不会编译emacs-eclim/company-emacs-eclim.el,我会收到以下错误:
Leaving directory `/home/wilfred/.emacs.d/elpa'
Compiling file /home/wilfred/.emacs.d/elpa/emacs-eclim-20130310.1237/company-emacs-eclim.el at Mon Mar 11 15:40:01 2013
Entering directory `/home/wilfred/.emacs.d/elpa/emacs-eclim-20130310.1237/'
company-emacs-eclim.el:35:1:Error: Cannot open load file: eclim
Warning: reference to free variable `multiple-cursors-mode'
Warning: reference to free variable `mc--read-char'
Warning: assignment to free variable `mc--read-char'
Warning: reference to free variable `multiple-cursors-mode'
Warning: reference to free variable `mc--read-quoted-char'
Warning: assignment to free variable `mc--read-quoted-char'
Warning: reference to free variable `rectangular-region-mode'
Warning: reference to free variable `rectangular-region-mode'
我该如何让Emacs只编译与package.el相同的文件?