I have suffered from the same error for many months.
Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)
I tried verifying the init.el
by the "bisecting" technique. I found that the init.el
file itself was not the cause of the error.
I tried 'M-x packge-refresh-contents' but it did not fix the problem.
Finally, I could fix the error by the following steps.
- take a backup of the
~/.emacs.d/
directory including theinit.el
file. - remove the
~/.emacs.d/
directory completely - recreate the
~/.emacs.d/
directory bymkdir
command - copy the
init.el
file from the backup into the newly created~/.emacs.d/
directory. - start emacs; effectively applying the restored
~/.emacs.d/init.el
file. - Emacs emitted some errors, that said some directories are missing under the
~/.emacs.d
, for example~/.emacs.d/conf
. So I created them as told to. - Emacs emitted some errors, that said 4 or 5 packages are refered to in the
init.el
but not actually installed. So I freshly installed those packages byM-x package-list-packages
. At this timing, I noticed that~/.emacs.d/elpa
directory was newly created and contents were downloaded. - Finally, my emacs launched without "Eager macro expansion error".
- A side effect; my emacs startstarts and become operational very quickly now. I suppose, it is because the
elpa
directory has the minimum packages installedjust a few seconds.
I think that I could fix the problem because I once removed the elpa
directory completely, and I recreated it and installed the packages fresh; so some file(s) that had caused the error disappeared. Which file? --- I don't know. Now I do not need to know it.
- My computer: Mac Book Air, 2018
- My OS: macOS Sonoma, version 14.7
- My Emacs version: 29.4