简体   繁体   English

如何使用emacs编译erlang项目

[英]how to compile erlang project with emacs

I had checked the doc of erlang-mode. 我检查了erlang-mode的文档。

it's seem that Cc Ck, (erlang-compile) - Compiles the Erlang module in the current buffer. 看来Cc Ck(erlang-compile)-在当前缓冲区中编译Erlang模块。

just compile one file of current buffer. 只需编译当前缓冲区的一个文件。 I wanna compile a project with rebar commond on emacs. 我想用emacs上常用的钢筋编译一个项目。 eg. 例如。 ./rebar compile ./钢筋编译

and it can display result like execute "erl -sname -pa ebin -pa deps/*/ebin". 它可以显示结果,例如执行“ erl -sname -pa ebin -pa deps / * / ebin”。

how to do this on emacs? 如何在emacs上做到这一点?

Doing this the "right" way involves inferior emacs shells and such, and isn't trivial. 以“正确”的方式执行此操作需要使用劣质的emacs外壳等,这并非易事。 But you can mostly get the desired effect with these two steps: 但是,您可以通过以下两个步骤获得所需的效果:

  1. At the top level of your project directory, which you can get to by visiting your rebar.config file, execute Mx compile and after hitting enter, change the compile command to rebar get-deps compile , then hit enter to run it. 在项目目录的顶层,可以通过访问rebar.config文件进入该目录,执行Mx compile ,然后按Enter键,将compile命令更改为rebar.config rebar get-deps compile ,然后按Enter键运行它。
  2. Assuming the compilation in the first step succeeds, execute Cu Mx erlang-shell and hit enter. 假设第一步的编译成功,执行Cu Mx erlang-shell并按Enter。 It will prompt you for the shell arguments, which should be 它将提示您输入shell参数,应为

    erl -pa deps/*/ebin -pa ebin

    Hit enter and you'll get an erlang shell prompt, with its erlang load path properly set up for your project. 按下回车键,您将得到一个erlang shell提示,并为您的项目正确设置了erlang加载路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM