[erlang-questions] Sharing code between modules with emacs

Martin Carlson martin@REDACTED
Mon Feb 19 12:52:21 CET 2007

Or you can add something like this to your erlang hook:

(unless (null buffer-file-name)
    (make-local-variable 'compile-command)
    (setq compile-command
	  (if (file-exists-p "Emakefile") "erl -make"
              "erlc "
               (if (file-exists-p "../ebin") "-o ../ebin " "")
               (if (file-exists-p "../include") "-I ../include " ""))
              "+debug_info -W " buffer-file-name)))))

In which case it will use a Emakefile if possible, else erlc with the
"right" switches depending on your environment

Martin Carlson
Erlang Training & Consulting

> Guest wrote:
> A second question : how can I make the emacs shell to compile the files in
> the ebin directory instead of the src one ?
> And have it looking for the .hrl in the include directory ?
> (end of quote)
> Assuming you follow Adams advise and create your Emakefile you can, when
> in Emacs (and is in the right working directory) use M-x and type in
> compile, enter, then erl -make and enter. This should compile the files
> and put them in whatever directory you specified.
> _________________________________________________________
> Post sent from http://www.trapexit.org
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list