This application will help you to fix the errors really fast. error_emacs will detect crashes in the shell and redirect emacs to that file and mark the line for you. The rest is (still) up to you.
I currently start it from my .erlang file but only when running the shell like this:
Args = init:get_arguments(), WantShell = case proplists:get_value(noshell, Args) of  -> false; true -> false; _ -> true end, if WantShell -> application:start(error_emacs); true -> ok end.
You must run emacs server in order to use error_emacs. So please add
;; ;; Emacs server - used by error_emacs.erl among other things ;; (server-start)
The program emacsclient must be found in the path, on Mac OS X you may have to add
To override the default emacsclient, but only if you are using the Emacs.app