[erlang-questions] rebar make

Gleb Peregud <>
Mon Apr 9 13:39:41 CEST 2012


On Mon, Apr 9, 2012 at 13:34, Tony Rogvall <> wrote:
> Hi list!
>
> I have a little work process problem.
> Since I switch to using rebar more and more, I want to be able to run to run simple
> "make command" from Emacs while in current directory (normally the src directory)
> How can this be achieved while getting the error messages and warnings in
> a form that emacs can parse (from the correct directory)
>
> I currently (and for a long time) use this little .emacs binding
>
> (global-set-key "^Xc" 'compile)

Hi Tony

Here's my solution to this problem based on emacs-Prelude, erlang-mode
and projectile (which is part of Emacs-prelude):

https://github.com/gleber/emacs-prelude/blob/master/modules/prelude-erlang.el#L50
https://github.com/gleber/emacs-prelude/blob/master/modules/prelude-erlang.el#L64

I think the code is self-explanatory. Essentially it runs "rebar
compile" or "make" depending on what type of support file it is able
to find in project root (rebar.config or Makefile).

I just hit <C-c C-k> to run compile and run <C-x `> to go through
through errors.

To make it work nicely with sub-projects in rebar, Tuncer made the
following change in rebar upon my request:
https://github.com/basho/rebar/commit/4a9dae76a41cf963a56f73ea5a7933f285802fec

Works like a charm!

Best regards,
Gleb



More information about the erlang-questions mailing list