Open Emacs with --debug-init on OS X

I am trying to debug why my .emacs does not load. Error message.

Invalid read syntax: # ... Start Emacs with
the `--debug-init' option to view a complete error backtrace.

My question is: How do I do that? What I've tried so far is this.

open -a --debug-init Emacs.app

Unable to find application named '--debug-init'

open -a Emacs.app --debug-init

open: unrecognized option `--debug-init'

I have my emacs configuration file in my home directory.


Solution 1:

I'm not on a Mac right now so I can't check, but this should work:

open -a /Applications/Emacs.app --args --debug-init

Note: requires Snow Leopard and later.

EDIT: You can also try this:

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

If that doesn't work, try capitalizing the "E" in "emacs". (I'm not sure how Emacs.app is structured internally, but the core executable should probably be one of the two.)