I have both .el
and the byte compiled version (.elc
) of an elisp file. Accidentally I delete the .el
file. Can I retrieve the .el
file from its .elc
version? Is an .elc
file without its .el
file functional?

- 7,849
- 4
- 41
- 87
2 Answers
I have both .el and the byte compiled version (.elc) of an elisp file. Accidentally I delete the .el file. Can I retrieve the .el file from its .elc version?
In practice, no.
In theory you could use the elc file to produce an el file with human readable definitions. However, this probably wouldn't look the same as the original file you deleted, due to macros and compiler optimizations, and even then I'm not aware of any libraries that do that.
Is an .elc file without its .el file functional?
Yes, Emacs is happy to load a .elc
file entirely by itself. No .el
file is necessary at all.
In fact, even when you do have both in the same directory, Emacs will usually load the elc anyway.

- 23,148
- 6
- 79
- 164
Check for a *.el~
file - there may be an Emacs backup of your missing *.el
file (which some tools will hide from you in their UI, so use something like ls -a
).

- 31
- 1
load-prefer-newer
is set tot
in emacs 24.4+, newer of the .el/.elc will be loaded. – Kaushal Modi Aug 11 '15 at 13:38