1

I have upgraded my emacs using brew install emacs-plus. Now when I run emacs & from the terminal, the following message appears.

Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)
Eager macro-expansion failure: (wrong-number-of-arguments (3 . 4) 2)
Error loading autoloads: (wrong-number-of-arguments (3 . 4) 2)

This message didn't used to appear before the upgrade. I'd like to resolve whatever the problem is, so that no message will appear upon startup.

As per the suggestions given in this post (specifically, in this comment), I have eliminated the init file altogether, but this didn't change the situation in any way.

My computer: iMac, late 2013
My OS: macOS Catalina, version 10.15.7
My Emacs version: 28.2 (9.0)

5
  • 1
    I have no solution for you, but that kind of error suggests that there are some out of date compiled emacs lisp files being used (.elc). emacs -Q --debug-init may be enough to pinpoint the culprit. It is surprising that this would happen with emacs -Q, though, since -Q should cause Emacs to load just the bare essentials, and brew should package Emacs up with the correct stuff. If I were you I would start fresh. Uninstall everything related to Emacs you have, unset any Emacs related environment variables (EMACSLOADPATH), move your .emacs.d directory aside, then re-install. Commented Nov 4, 2022 at 16:01
  • 1
    Another thing to look at: emacs.stackexchange.com/questions/74302/…. Just because you start with emacs -Q doesn't prevent Emacs from looking at some things in your .emacs.d, though arguably for a byte compiled elisp problem it should handle what happened to your more gracefully. See also the comment on that post: If you want a completely clean emacs startup, then you need to do HOME=/tmp emacs -Q -- but I would suggest some directory other than /tmp -- make a new temp dir that is empty instead. Commented Nov 4, 2022 at 16:14
  • @MattArmstrong I never said that this happened with emacs -Q. It doesn't. I uninstalled the previous version of emacs before installing the new one with Homebrew. What should I look for when running emacs -Q --debug-init?
    – Evan Aad
    Commented Nov 4, 2022 at 18:51
  • @MattArmstrong In my system there is no files named ~/.emacs, ~/.emacs.el, ~/.emacs.d/init.el, or ~/.config/emacs/init.el, and the entire computer doesn't contain any files named default.el or site-start.el.
    – Evan Aad
    Commented Nov 4, 2022 at 18:57
  • @MattArmstrong With HOME=/tmp emacs the error message doesn't occur.
    – Evan Aad
    Commented Nov 5, 2022 at 6:55

2 Answers 2

0

The error message was resolved once the package list was updated.

0

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.

  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".
  9. A side effect; my emacs starts and become operational very quickly, just 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

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.