LoginSignup
10
10

ディレクトリ内のすべてのEmacs Lispファイルを一発でバイトコンパイル

Last updated at Posted at 2014-11-18

ディレクトリ内のEmacs Lispファイルを一発でバイトコンパイルするには,
Emacsから下記を実行すれば良い.

C-u 0 M-x byte-recompile-directory

しかし, 再帰的には適用されないため,
第2階層以降のディレクトリ内にあるファイルはバイトコンパイルできない.

そこで, Emacs内からでなく, 下記のようにコマンドラインからバイトコンパイルできることを利用する.

$ emacs -batch -f batch-byte-compile /path/to/*.el

したがって, 下記のようにすれば, ディレクトリ内のファイルを再帰的にバイトコンパイルできる.

$ find /path/to -name '*.el' | xargs emacs -batch -f batch-byte-compile

なお, Zshでは簡潔に, 下記でバイトコンパイルできる.

$ emacs -batch -f batch-byte-compile /path/to/**/*.el
10
10
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10