0
votes

I had checked the doc of erlang-mode.

it's seem that C-c C-k, (erlang-compile) - Compiles the Erlang module in the current buffer.

just compile one file of current buffer. I wanna compile a project with rebar commond on emacs. eg. ./rebar compile

and it can display result like execute "erl -sname -pa ebin -pa deps/*/ebin".

how to do this on emacs?

1
This is probably more appropriate for emacs.stackexchange.comMakyen

1 Answers

2
votes

Doing this the "right" way involves inferior emacs shells and such, and isn't trivial. But you can mostly get the desired effect with these two steps:

  1. At the top level of your project directory, which you can get to by visiting your rebar.config file, execute M-x compile and after hitting enter, change the compile command to rebar get-deps compile, then hit enter to run it.
  2. Assuming the compilation in the first step succeeds, execute C-u M-x erlang-shell and hit enter. It will prompt you for the shell arguments, which should be

    erl -pa deps/*/ebin -pa ebin

    Hit enter and you'll get an erlang shell prompt, with its erlang load path properly set up for your project.