 (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))))
+		      (file-name-directory (erlang-local-buffer-file-name))))
 	 (parent-dir (directory-file-name
 		      (file-name-directory buffer-dir)))
          (ebin-dir (concat (file-name-as-directory parent-dir) "ebin"))

	(res (inferior-erlang-compute-erl-compile-command module-name opts))
	ccfn-entry
	done)
    (if (not (null (buffer-file-name)))
	(while (and (not done) (not (null ccfn)))
	  (setq ccfn-entry (car ccfn))
	  (setq ccfn (cdr ccfn))
	  (if (string-match (car ccfn-entry) (buffer-file-name))
	      (let ((c-fn (cdr ccfn-entry)))
		(setq done t)
		(if (not (null c-fn))

	 tmpvar tmpvar tmpvar2)))))

(defun inferior-erlang-compute-leex-compile-command (module-name opts)
  (let ((file-name        (erlang-local-buffer-file-name))
	(erl-compile-expr (inferior-erlang-remove-any-trailing-dot
			   (inferior-erlang-compute-erl-compile-command
			    module-name opts))))
