If you configured your directory structure as follows:
/ /src/ /ebin/
and put your module (for example, "my_file.erl") in the directory "/ src /", then compile it (Cc Ck), then Emacs should automatically put the beam in the directory "/ ebin /".
However, if your module is not located in the directory with the name "/ src /" (or if the directory "ebin" is missing), the beam will be deleted along with the source file.
To find out how it works, take a look at $ ERL_TOP / lib / tools / emacs / erlang.el and search for "ebin". Here's what you find:
(defun inferior-erlang-compile-outdir () "Return the directory to compile the current buffer into." (let* ((buffer-dir (directory-file-name (file-name-directory (buffer-file-name)))) (parent-dir (directory-file-name (file-name-directory buffer-dir))) (ebin-dir (concat (file-name-as-directory parent-dir) "ebin")) (buffer-dir-base-name (file-name-nondirectory (expand-file-name (concat (file-name-as-directory 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))))
Not sure when this product was added, but it was in OTP_R13B03 , and it works for me in R14B03.
Bryan hunter
source share