Since I switched to a Mac as my primary development platform I am using aquamacs for all my coding needs. It is a fast native app, looks good, is highly customizable and together with distel it integrates very well with Erlang. Just one thing was giving me a headache:
Compiling from within Emacs based on an Emakefile
I tried some hacks recently discussed on the Erlang mailing list, but at first try did not manage to adapt those hacks to fit my needs. The situation got worse when I started to use non-Erlang source files such as templates and lexer / parser grammars which all get compiled to beam files and need to be reloaded when compilation was successful. After digging a bit into Emacs Lisp I came up with the following approach:
By pressing a function key (F13 in my case) emacs invokes via RPC at the Erlang application a custom compile command which in case of an Erlang source file switches to the directory of the Emakefile, runs a make:all([load]). and switches back to the original directory of the currently edited file. If the source file is a non-Erlang, than custom code gets called to perform all the necessary steps until beam file reloading.