現在、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'
package.el と同じファイルだけを Emacs でバイトコンパイルするにはどうすればよいですか?