views:

95

answers:

4

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, yasnippet.el -> yasnippet.elc)?

+3  A: 

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 .

Pascal Cuoq
+6  A: 

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
Noufal Ibrahim
Nice trick. You just made my .emacs grow a little larger.
Pascal Cuoq
Addictive thing... emacs.. isn't it? :)
Noufal Ibrahim
Very helpful. Emacs even tell you how to improve the file. A last question: where do I place the .elc files? Is better to place them ina folder or in the same folder as their .el?
janoChen
I put them in the same directory since otherwise, I'd have to mess with my load-path and stuff.
Noufal Ibrahim
+1 for the function.
vedang
+2  A: 

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

Zitrax
+1  A: 

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.

pheaver