C
Byte-compilation is a function of Emacs that transforms Lisp into byte-code. Byte-code, run by an interpreter in Emacs, can be executed more quickly than Lisp. However, because it isn't written in machine code, it can be directly transferred between machines without having to be recompiled. Functions byte-compiled by earlier versions of Emacs can be correctly interpreted by Emacs, but the opposite is not necessarily true.
To byte-compile a file, launch Emacs and enter: M-x byte-compile-file RET [file to byte-compile] Replace [file to byte-compile] with the name of the file you want to compile. The compiler will take the file, which should end in the extension .el , and create a byte-code version with the extension .elc.
How do I byte-compile everything in my .emacs.d directory?
C-u 0 M-x byte-recompile-directory
will compile all the .el files in the directory and in all subdirectories below.
The C-u 0 part is to make it not ask about every .el file that does not have a .elc counterpart.
To automatically byte compile everything that needs byte compiling each time I start emacs, I put the following after my changes to load-path at the top of my .emacs file:
(byte-recompile-directory (expand-file-name "~/.emacs.d") 0)
本文介绍了Emacs中字节编译的功能,该功能可以将Lisp代码转换为字节码,提高执行效率并便于跨平台移植。文章还提供了如何进行文件及目录级别的字节编译操作,并给出了一种自动编译的方法。
1715

被折叠的 条评论
为什么被折叠?



