I'm definitely loading the correct file. There's no rogue ~/.emacs or byte compiled file.

When I load emacs, even with my entire init.el commented out, the first line in *messages*, the first line is messages is (wrong-type-argument stringp nil) [36 times].

If I run emacs with my init.el totally commented out, and --debug-init, I don't get backtraces for these errors.

If I invoke emacs with -q, I don't get these errors at all in *messages*.

I'm not sure how to proceed in debugging this, but there are more normal problems too, so I can't just ignore. For example, zenburn won't load - it too fails with (wrong-type-argument stringp nil), but I can get a backtrace for this, and it's related caused by file-name-directory receiving nil.

If I 'manually' load my commented-out init file, by running emacs -q -l init.el there are no complaints about (wrong-type-argument stringp nil) [36 times] What could be causing these initial, non debug-on-initable stringp errors, and how can I fix them?

  • EDIT - New information. Deleting every .elc in elpa seems to fix this problem, and recompiling the .elc files re-introduces it.
  • Perhaps you compiled your init.el file and that's (init.elc) what is getting loaded?
    – rlazo
    May 5, 2015 at 11:16
  • 1
    Can you first ensure that the init.el you are debugging is actually being read by emacs? Put a line like (message "Beginning of init") at the very beginning of that file and something like (message "End of init") at its end. If your init is causing those errors, they should come between those 2 messages. Make sure that you don't have a ~/.emacs lying around because emacs will pick that up instead if available. May 5, 2015 at 12:02
  • If the messages do get printed and the errors happen before the Beginning of init display in *Messages*, then you need to start looking into the presence of .dir-locals.el and such. May 5, 2015 at 12:03
  • 1
    Based on your latest update about .elc files, then try narrowing down to the package whose .elc caused this problem. For simplicity, rename the elpa/ dir to something like elpa.bkp/ and then move dirs (already containing the elc files) using binary approach (first move half of the package dirs, restart emacs, if things are good, move half from the remaining, repeat) from elpa.bkp/ to elpa/. May 14, 2015 at 15:00

1 Answer 1


Maybe you're not loading the init file you think you're loading.

Double check if the init.el file you use with -q and --debug-init is the same file you use when loading emacs normally. Check for the first line in *Messages* starting with Loading <path-to-init-file>...

  • 2
    This looks like a comment rather than an answer May 5, 2015 at 10:50
  • It's definitely the same file
    – Squidly
    May 5, 2015 at 11:12
  • 1
    No, this looks like an answer, not a comment, to me. It might not be an ideal or complete answer, but it is an answer, and a good one. The OP explicitly asked about "how to proceed in debugging this". This answer is a start.
    – Drew
    May 5, 2015 at 14:45
  • @AndrewSwann, indeed I wanted to provide a comment originally. But I don't have enough reputation to do so yet.
    – bjacquet
    May 8, 2015 at 22:55

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.