开发者

It is possible (and normal practice) to byte-compile files other than .emacs?

I'm using some plugins and I byte-compiled my .emacs but the start up still slow. Do I hava to byte-compile my prlugins too? (for instance, y开发者_StackOverflow社区asnippet.el -> yasnippet.elc)?


Byte compiled files load up faster so I'd recommend that you byte compile everything as Pascal suggested. I also keep this in my init file so automatically byte compile all the emacs lisp files I edit and save.

(add-hook 'emacs-lisp-mode-hook '(lambda () 
               (add-hook 'after-save-hook 'emacs-lisp-byte-compile t t)))   ;; Automatically byte-compile emacs-lisp files upon save


Emacs can feel slow to start up even without any .emacs or plugins :)

It is a good idea to compile plug-ins, that's as much time shaved from start-up. Compiling the .emacs configuration file is less usual (because it changes more often and is typically small anyway), but why not?

You probably already know this, but .el files can be byte-compiled using: M-x byte-compile-file or M-x byte-recompile-directory .


You can use emacs server to speed things up, then it only takes time to start the server the first time.

The way to start an Emacs server is to run Emacs as a daemon, using the ‘--daemon’ command-line option. When Emacs is started this way, it calls server-start after initialization, and returns control to the calling terminal instead of opening an initial frame; it then waits in the background, listening for edit requests.

Once an Emacs server is set up, you can use a shell command called emacsclient to connect to the existing Emacs process and tell it to visit a file. If you set the EDITOR environment variable to ‘emacsclient’, programs such as mail will use the existing Emacs process for editing.

From: http://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html


You'll likely find something use here: http://www.emacswiki.org/emacs/AutoRecompile

A great selection of tips for automatically byte-compiling files, when you save them or when you load them, and even caching the compiled files in a certain directory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜