[erlang-questions] "Automatic" recompile app from a console

Garrett Smith g@REDACTED
Thu Jan 31 23:36:27 CET 2013


On Thu, Jan 31, 2013 at 3:32 PM, John Kemp <john@REDACTED> wrote:
> On 01/31/2013 04:25 PM, Garrett Smith wrote:
>
>> You're asking about a completely different workflow, but on the
>> outside chance you're simply looking for a streamlined way to
>> integrate the shell with your programming,
>
>
> I am :)
>
>
>> this is what I use:
>>
>> - Edit and compile source explicitly (I have a key binding to run
>> "make" in Emacs, but I'm sure most editors have an easy equivalent)
>
>
> This is the part that was failing for me, actually - I get an error about
> reloading a beam file when I ran the make from within emacs. Works OK from a
> command line, but not from emacs.

This is what I have in my emacs.d/init.el:

(global-set-key (kbd "C-x RET") 'compile)

So it's CTRL-C M and I get the compile prompt, which defaults to "make
-k", then enter. Of course I have a Makefile that contains ./rebar
compile in the default target.

Emacs knows how to go to the source line on error with CTRL `

I personally would not want my compiler to auto-compile when I saved
the file, though I realize some IDEs not only do that, but try to
compile as you type! Everyone has a different thing though.

>>
>> - Let mochiweb's reloader, which is started using the "-s reloader"
>> option, automatically reload the modified beams
>>
>> I *live* in the Erlang shell during development, always using this
>> workflow. When I watch others constantly closing and restarting the
>> Erlang shell in between changes, I wonder how on earth they get
>> anything done :)
>
>
> I programmed in Erlang a few years ago and gave it up. I don't remember how
> I worked before but I'm pretty sure I wouldn't have lived with this either
> :) So now I need to get it working again...

Good luck!

Garrett



More information about the erlang-questions mailing list