我正在使用erlang模式。梁是在与源文件相同的文件夹中生成的,源文件位于嵌套文件夹中,而不仅仅是文件夹src中。
我想我应该覆盖erlang.el 中的inferior-erlang-compile-outdir,但我失败了。
以下是我的功能:
(defun inferior-erlang-compile-outdir ()
(let* (format "%s/ebin" (get-project-path))))
PS:get-project-path是获取我的项目根路径的函数。
===========更新==================
(require-package 'erlang)
;; add include directory to default compile path.
(defvar erlang-compile-extra-opts
'(bin_opt_info
debug_info
(i . "../include")
(i . "../../include")))
;; define where put beam files.
(defun inferior-erlang-compile-outdir ()
(concat (get-closest-pathname) "/ebin" ))
(require 'erlang-start)
;;----------------------------------------------------------------------------
;; Get closest pathname of file
;;----------------------------------------------------------------------------
(defun* get-closest-pathname (&optional (file "Makefile"))
(let ((dir (locate-dominating-file default-directory file)))
(or dir default-directory)))