tags:

views:

68

answers:

3

Is there a way to know if Emacs is actually using a byte compiled file (.elc)? It is necessary to put all .elc files i a folder or just in the same directory has their original .el?

A: 

You can look at the messages buffer to see if it's loading up the .elc or the .el when you do a require.

I'd put the byte compiled files in the same directory as the originals because then the requires would work fine and pick up the byte compiled versions without me having to manipulate the load-path.

Noufal Ibrahim
Thanks but, how to do a require?
janoChen
`(require 'package)` where package is the name of your .el file. The .el file will have a corresponding `provide`.
Noufal Ibrahim
A: 

You could always look up the buffer messages when the emacs starts, also for verbosity, you could start emacs in debug mode.

You can also explicitly specify to require .elc files This is how the require works,

(require 'foo "/home/user/experimental/foo.el")

if you have bite compiled files just replace the .el to .elc, that would load the byte compiled files.

_sh
+1  A: 

Yes it is certainly possible to see if your .emacs is actually a .emacs.elc by examining user-init-file:

(if user-init-file
    (if (string-match ".elc" user-init-file)
    (message "Running precompiled .emacs")))

I'm not sure about testing arbitrary files being evaluated though.

stsquad