如何对.emacs.d目录中的所有内容进行字节编译? [英] How do I byte-compile everything in my .emacs.d directory?

查看:146
本文介绍了如何对.emacs.d目录中的所有内容进行字节编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我决定查看Emacs,我非常喜欢。现在,我正在使用 Emacs入门工具包,哪种提供更好的默认值和一些不错的自定义默认安装Emacs。



我已经定制了一点,添加了一些东西,如 yasnippet color-themes 未绑定和其他内容。我已经设置了一个 github存储库,在那里我保留所有的自定义所以我可以从多个地方访问它们,或者一旦发生变化,我丢失了.emacs.d目录。



所有这一切都是非常好的,但是有一个问题:Emacs需要约1-2秒才能加载。 AFAIK我可以使用M-x字节编译文件将.el文件编译成.elc,它可以正常工作。但是有很多的.el文件,我想知道是否有一种方法可以用简单的命令或东西来编译它们,以加快加载Emacs。我的Emacs并不总是开放的,我经常打开和关闭它,特别是在我将Total Commander中的编辑命令设置为默认编辑器后,更快地使用它(是的,这里是windows xp)。 p>

我的Emacs版本是22.3。是的,没有任何自定义的默认Emacs安装会立即启动。



我不知道在加载时使用哪个版本,.el或。那么,是否有一个elisp命令或Emacs命令行切换,使Emacs字节编译.emacs.d目录中的所有内容?

解决方案

Cu 0 Mx byte-recompile-directory



将编译目录中以及以下所有子目录中的所有.el文件。



Cu 0 部分是不要问每个.el文件没有.elc对应。


I have decided to check out Emacs, and I liked it very much. Now, I'm using the Emacs Starter Kit, which sort of provides better defaults and some nice customizations to default install of Emacs.

I have customized it a little, added some stuff like yasnippet, color-themes, unbound, and other stuff. I've set up a github repository where I keep all of the customizations so I can access them from multiple places or in case something goes bad and I lose my .emacs.d directory.

All of this is very nice, but there is a problem: Emacs takes about 1-2 seconds to load. AFAIK I can compile individual .el files with M-x byte-compile-file to .elc, and it works. But there are a lot of .el files, and I wonder if there is a way to compile them all with a simple command or something, to speed up the loading of Emacs. My Emacs is not always open, and I open and close it quite frequently, especially after I've set it up as a default editor for edit command in Total Commander to get used to it faster (yeah, windows xp here).

My Emacs version is 22.3. And yes, the default Emacs installation without any customizations fires up instantly.

I am not sure which version is preferred when loading, the .el or compiled .elc one by the way O.o

So, is there an elisp command or Emacs command line switch to make Emacs byte-compile everything in .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.

这篇关于如何对.emacs.d目录中的所有内容进行字节编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆