Patching the erlang.el mode
Let's have emacs to compile in ebin directory
In mailing lists I have found a trick, but is not that clear how to apply it. I worked on it, and at the end, I correctly understood how to make the suggested change. To make things easier, here is a patch:
To apply it, on a Mac, select the code before and copy in the clipboard. Then do:
Now paste, then type ^d.
Now you should see
Done! Now when you compile, IF exists ../ebin, the beam will be placed there.
If you are using a not-unix platform or you are too lazy to apply the patch, simply download the attachment and replace the erlang.el file.
*** erlang.el.orig Mon Aug 11 18:17:02 2008
--- erlang.el Mon Aug 11 18:56:36 2008
***************
*** 5726,5730 ****
compile command `c' when using the option `outdir'.
! There exists two workarounds for this bug:
1) Place the directory in the Erlang load path.
--- 5726,5730 ----
compile command `c' when using the option `outdir'.
! There exists two workarounds dirfor this bug:
1) Place the directory in the Erlang load path.
***************
*** 5740,5744 ****
(or (inferior-erlang-running-p)
(error "Error starting inferior Erlang shell"))
! (let ((dir (file-name-directory (buffer-file-name)))
;;; (file (file-name-nondirectory (buffer-file-name)))
(noext (substring (buffer-file-name) 0 -4))
--- 5740,5748 ----
(or (inferior-erlang-running-p)
(error "Error starting inferior Erlang shell"))
! (let* (
! (buffer-dir (file-name-directory (buffer-file-name)))
! (ebin (concat buffer-dir "../ebin/"))
! (dir (if (file-readable-p ebin) ebin buffer-dir))
! ;(dir (file-name-directory (buffer-file-name)))
;;; (file (file-name-nondirectory (buffer-file-name)))
(noext (substring (buffer-file-name) 0 -4))
To apply it, on a Mac, select the code before and copy in the clipboard. Then do:
cd /usr/local/lib/erlang/lib/tools-2.6.1/emacs/
cp erlang.el erlang.el.backup
patch
Now paste, then type ^d.
Now you should see
patching file erlang.el
Hunk #2 succeeded at 5740 with fuzz 1.
Done! Now when you compile, IF exists ../ebin, the beam will be placed there.
If you are using a not-unix platform or you are too lazy to apply the patch, simply download the attachment and replace the erlang.el file.