1

I would like Emacs to not use byte-compiled files because the stack-trace is really messy.

So for my own elisp files, I can add ;; -*-no-byte-compile: t; -*- to disallow byte-compilation.

But how can I enforce this for the packages like evil downloaded from elpa, melpa etc?

  1. Can I prevent package installation from byte-compiling so that there are no .elc's created in the first place?
  2. If that is not possible, I could probably delete them, but would that not be recreated or is that automatically happening during the installation only?

The comment says that I can remove the load-path of .elc, but as far as I know, both .el and .elc is on the same path!

Nishant
  • 239
  • 1
  • 9
  • Is this a duplicate of https://emacs.stackexchange.com/questions/36846/package-el-how-can-i-avoid-byte-compilation? – Nishant Jan 30 '18 at 21:25
  • No, that question is about avoiding/preventing compiling. This question seems to be about not loading existing *.elc files. But it's your question! So you tell us - is that question really what you want to ask? If so, delete this one. – Drew Jan 30 '18 at 22:49
  • You can always delete byte-compiled files or move them out of your `load-path` (directly or indirectly). – Drew Jan 30 '18 at 22:50
  • 2
    This may help: https://emacs.stackexchange.com/a/31029 – glucas Jan 31 '18 at 01:27
  • Possible duplicate of [Does \`load\` prefer .elc files over .el files?](https://emacs.stackexchange.com/questions/31020/does-load-prefer-elc-files-over-el-files) – Yasushi Shoji Jan 31 '18 at 03:32
  • @YasushiShoji: This is not a duplicate of that question either, AFAICT. – Drew Jan 31 '18 at 15:01

1 Answers1

2

You can prevent package installation from byte-compiling. Write the following one liner in ~/.emacs.d/elpa/.dir-locals.el. This is described in package.el: How can I avoid byte-compilation

((emacs-lisp-mode . ((no-byte-compile . t))))

Or you can make Emacs to only load .el files, no .elc files. Write the following code in your .init.el. This is described in Does `load` prefer .elc files over .el files?

(setq load-suffixes '(".el"))
Yasushi Shoji
  • 2,151
  • 15
  • 35
  • Trying to achieve the same objective (don't load any byte-compiled LISP) in a different environment with straight.el as package manager. Both `(setq load-suffixes '(".el"))` or `(setq load-suffixes '(".el" ".elc"))` in my init.el result in the following error on startup: `Eager macro-expansion failure: (error "Recursive load" "/usr/local/share/emacs/27.2/lisp/jka-compr.el.gz" ... ) [8 times]` – lbo Feb 02 '23 at 09:56