I'm running Emacs from HEAD on Mac OS. I installed emacs-plus using the --HEAD argument with homebrew.

I did a whole grep for (package-initialize) in ~/.emacs.d/. The only reference I found to it is in elpa/flycheck, and I odn't require it at all, so it shouldn't run. Just to be safe, I customize the flycheck-emacs-lisp-initialize-packages variable to nil, meaning that flycheck shouldn't run package-initialize at all.

Is there anything I'm missing? Is there another place I should be checking?

  • Have you tried removing all byte-compiled files? They could be out of date, and one of them could have a call to that function. – user12563 Jul 14 '19 at 12:50
  • Where is your init file? – phils Jul 14 '19 at 13:14
  • I deletd all of my own byte-compiled files (I used rm *.elc in the directory with all my .el files). Also, my init file is in ~/.emacs.d/init.el. – Parham Doustdar Jul 14 '19 at 13:52
  • Go to its source through, eg. C-h package-initialize and then RET on the link to the file. Then instrument it for debugging, I think it's C-u C-M-x or something like that. Then, re-evaluate your init file. When you enter debugger, you can examine the backtrace, and, hopefully, locate the call, most likely it is caused indirectly by something in another package. – wvxvw Jul 14 '19 at 15:33

Thanks to the comment by @wvxvw, this is how I finally ended up solving the problem.

Initially, I tried going to package-initialize, and instrumenting it (by pressing C-u C-M-x) which causes it to open the debugger whenever it's called. Unfortunately, evaluating my init file by opening it and running M-x eval-buffer <RET> didn't cause the debugger to open. I guess this is because the piece of code that calls package-initialize was not being called any more.

So I put this at the top of my init file:

(debug-on-entry 'package-initialize)

Then I restarted Emacs and voila! I finally saw the debugger, which pointed me to the emacspeak package

I've already reported this to the author, but I'll go ahead and ignore this for now.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.