I'm setting up some site-wide default configuration in the site-lisp directory, and trying to figure out whether emacs is loading the byte-compiled default.elc or default.el. I haven't applied any other configuration, such as load-prefer-newer.

With the following default.el

(defvar foo nil)

and having compiled it so both the .el and .elc files are present, if I run describe-symbol on foo I'm shown:

foo is a variable defined in 'default.el'

and the *Messages* buffer shows the path to default.el (as if it loaded it to look up the symbol, though I don't know if that's actually what it means).

If I remove the .el file leaving only the .elc file, then start emacs and again describe foo it shows:

foo is a variable defined in 'default.elc'

and in the *Messages* buffer I see the path to default.elc.

I had expected it to load the byte-compiled .elc file when both were present, but can't tell if that's what's happening. How can I check?

  • One option is to inspect or save the value of load-file-name in default.el, which will give you the name of the file that was actually loaded.
    – Basil
    Jan 18, 2020 at 22:23

1 Answer 1


C-h v load-history

Then search the variable value (in buffer *Help*) for the library you're interested in, e.g. default.el or default.elc.

  • Perfect, thanks! It was indeed loading the .elc file, which is what I was hoping for.
    – ivan
    Jan 18, 2020 at 22:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.