Skip to main content
2 of 9
added 92 characters in body

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 "bisecting" technique. I could not identify the cause by this. 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 fixed the problem.

Finally, I could fix the error by the following steps.

  1. take a backup of the ~/.emacs.d/ directory including the init.el file.
  2. remove the ~/.emacs.d/ directory completely
  3. recreate the ~/.emacs.d/ directory by mkdir command
  4. copy the init.el file from the backup into the newly created ~/.emacs.d/ directory.
  5. start emacs; effectively applying the restored ~/.emacs.d/init.el file.
  6. 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.
  7. 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 by M-x package-list-packages. At this timing, I noticed that ~/.emacs.d/elpa directory was newly created and contents were downloaded.
  8. Finally, my emacs launched without "Eager macro expansion error".

I think that I could fix the problem because I once removed the elpa directory completely, and I recreated it with fresh package contents.

My computer: Mac Book Air, 2019 My OS: macOS Sonoma, version 14.7 My Emacs version: 29.4