emacserlangaquamacsflymake

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. I followed the directions here:

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.)

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:

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:

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

I tried reloading Preferences.el:

M-x eval-buffer

And, I tried quitting Aquamacs and relaunching it, but I still get the config error.

I added the line:

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

to Preferences.el, and I see the output in the Messages buffer.

I noticed that the escript specifies an include directory:

{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.

I also executed the syntax checking escript (at the link above) as a stand alone erlang program, and it runs with no errors.

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:

~/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.


Solution

  • The instructions on that wiki page seem to be obsolete. With the current erlang-mode, all you need to do is add the following to your .emacs file:

    (require 'erlang-flymake)
    

    That should set up the appropriate hook for running flymake in buffers visiting Erlang source files.