简体   繁体   English

Aquamacs Erlang flymake配置错误

[英]Aquamacs Erlang flymake configuration error

OSX 10.10.5  
Aquamacs 3.3 GNU Emacs 25.1.1   
(x86_64-apple-darwin14.1.0, NS appkit-1344.72 Version 10.10.2   
(Build 14C109))of 2016-09-19 on 24a02db

I'm trying to get flymake to work with Erlang files. 我正在尝试使flymake与Erlang文件一起使用。 I followed the directions here: 我按照这里的指示进行:

https://www.emacswiki.org/emacs/FlymakeErlang https://www.emacswiki.org/emacs/FlymakeErlang

But when I do: 但是当我这样做时:

M-x flymake-mode

I get the error: 我收到错误:

Flymake: Configuration error has occurred while running  
(/Users/me/Library/Preferences/Aquamacs Emacs/my_erlang_valid_checker.erl  
aqua_flymake.erl). Flymake will be switched OFF

(The erlang file I was editing was named aqua.erl.) (我正在编辑的erlang文件名为aqua.erl。)

I used the initialization file: 我使用了初始化文件:

~/Library/Preferences/Aquamacs\ Emacs/Preferences.el

I put the escript (at the link above) in the same directory and named it: 我将escript(位于上面的链接中)放在同一目录中并命名为:

my_erlang_valid_checker.erl

I also made it executable: 我还使其可执行:

$ chmod a+x my_erlang_valid_checker.erl

And, I changed the following line in the lisp code that I put into Preferences.el to specify the path to that file: 并且,我更改了放入Preferences.el的lisp代码中的以下行,以指定该文件的路径:

(list "~/Library/Preferences/Aquamacs\ Emacs/my_erlang_valid_checker.erl"  
(list local-file))))

I tried reloading Preferences.el: 我尝试重新加载Preferences.el:

M-x eval-buffer

And, I tried quitting Aquamacs and relaunching it, but I still get the config error. 而且,我尝试退出Aquamacs并重新启动它,但是仍然出现配置错误。

I added the line: 我添加了一行:

(message "************ Aquamacs **************")

to Preferences.el, and I see the output in the Messages buffer. 到Preferences.el,然后在“消息”缓冲区中看到输出。

I noticed that the escript specifies an include directory: 我注意到该escript指定了一个include目录:

{i, "../include"}]

but the directory: 但目录:

~/Library/Preferences/include

doesn't exist, so I tried removing the include directory from the escript, but that didn't fix the configuration error. 不存在,因此我尝试从escript中删除include目录,但这不能解决配置错误。

I also executed the syntax checking escript (at the link above) as a stand alone erlang program, and it runs with no errors. 我还作为独立的erlang程序执行了语法检查escript(在上面的链接中),并且运行没有错误。

It's my understanding that flymake is already installed in Aquamacs, but I tried putting a copy of flymake.el in the same directory as my init file: 据我了解,Aquamacs中已经安装了flymake,但是我尝试将flymake.el的副本放在与我的初始化文件相同的目录中:

~/Library/Preferences/Aquamacs\ Emacs/

That directory is in my load path, as shown by: 该目录位于我的加载路径中,如下所示:

C-h v load-path RET

but I still got the configuration error. 但我仍然收到配置错误。

The instructions on that wiki page seem to be obsolete. 该Wiki页面上的说明似乎已过时。 With the current erlang-mode, all you need to do is add the following to your .emacs file: 使用当前的erlang模式,您需要做的就是将以下内容添加到.emacs文件中:

(require 'erlang-flymake)

That should set up the appropriate hook for running flymake in buffers visiting Erlang source files. 那应该设置适当的钩子,以便在访问Erlang源文件的缓冲区中运行flymake。

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

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