Теперь я устанавливаю столько, сколько могу, через MELPA и Marmalade, и я управляю своим ~/.emacs.d с помощью git. Однако у меня есть файлы git ignore *.elc.
Это означает, что, когда я устанавливаю пакет в одной системе и затем запускаю другую систему, 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?