On startup I'm getting this message:

Eager macro-expansion failure: (wrong-number-of-arguments (3 . 3) 2)

How can I find whats causing the warning? --debug-init doesn't do anything in this case as it does with many other errors.

  • You find internal-macroexpand-for-load in macroexp.el. You could copy the code to the beginning of your init-file (maybe early-init file) and include the form argument and the load file in the message string, i.e., (message "Eager macro-expansion failure: %S form: %S load file: %S" err form load-file-name). Maybe that helps to identify the problem. – Tobias Dec 19 '19 at 15:07
  • If starting Emacs using emacs -Q doesn't show the problem then blame your init file. The easiest approach to finding a problem in your init file is to bisect your init file. That's a binary search - very quick to do. – Drew Dec 19 '19 at 15:41
  • @Drew It depends on the situation whether bisection is really the best way to go. My init file ~/.emacs loads 60 files ~/.emacs.d/[0-9][0-9]*.el. That does not include the libraries that are loaded from those. I've got some mechanism that allows me to select just a bunch of those files if I have problems. Even so this is not enjoyable and a direct hint on what goes wrong is really nice. – Tobias Dec 19 '19 at 20:45
  • @Tobias: Even if your init file loads 60,000 files, it's still the quickest way. Unless, of course, you already have a good idea where the problem likely lies. If not, then cutting the search space in half for each quick test is as good as it gets. (And all too often we can think we have a good idea where the problem might lie, and end up wasting time going down rabbit holes.) No, it's not always the best approach. Yes, it's the best approach, every thing else being equal (i.e., no good knowledge). – Drew Dec 19 '19 at 21:00
  • 1
    @Tobias: OP wants to trace eager macroexpansion - a legitimate aim/question in its own right. Not necessarily the quickest way to solve the given wrong-args problem, but good to know - a good question - in any case. – Drew Dec 19 '19 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.