[erlang-questions] Sharing code between modules with emacs

Petter Larsson petter.xa.larsson@REDACTED
Fri Feb 16 13:10:20 CET 2007


You can check how your inferior-erlang-compile in your elang.el
There you set the dir. You can there use another function to set the dir.
In my version (thanks to Tomas Abrahamsson) i have:
(let ((dir (inferior-erlang-compile-outdir))

And this function is defined as:

(defun inferior-erlang-compile-outdir ()
   "Return the directory to compile the current buffer into."
   (let* ((buffer-dir (file-name-directory (buffer-file-name)))
          (ebin-dir (concat buffer-dir "../ebin/"))
          (buffer-dir-base-name (file-name-nondirectory
                                 (expand-file-name (concat buffer-dir 
".")))))
     (if (and (string= buffer-dir-base-name "src")
              (file-directory-p ebin-dir))
         (file-name-as-directory ebin-dir)
       (file-name-as-directory buffer-dir))))



On 2007-02-16 12:31, Mazen wrote:
> 
> 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