How do I start Emacs with the debug init option?

The warning that I get, as soon as I open Emacs is this:

Warning (initialization): An error occurred while loading `/Users/Kaileeena/.emacs':

End of file during parsing: /Users/Kaileeena/.emacs

To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the `--debug-init' option to view a complete error backtrace.

But how do I do that?

I've never used this software before, and I can't figure out where to even type.


You're running Mac OS, right? Assuming you installed Emacs into the Applications folder, open a Terminal window (it's in the Utilities subfolder inside Applications) and type:

/Applications/Emacs.app/Contents/MacOS/Emacs --debug-init

In addition to the suggestions to use emacs --debug-init, do this: Bisect your init file (~/.emacs) recursively until you find the problematic code. (E.g., use M-x comment-region to comment out half the code, then 1/4, then 1/8, then 1/16,... (With prefix arg C-u the same command uncomments the region.)

This is a binary search, so it is very quick to do.

But as @Adobe suggested, it is likely that you are missing one or more closing parens. Another approach is to use C-M-f repeatedly (just hold down that chord), until you get the error. That will be where you are missing a paren. (Start at the top level of the file and the leftmost paren of your first sexp.)