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

7stud
  • 46,922
  • 14
  • 101
  • 127

1 Answers1

1

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.

7stud
  • 46,922
  • 14
  • 101
  • 127
legoscia
  • 39,593
  • 22
  • 116
  • 167
  • 1
    Ha! A miracle from the heavens! It works great. Thanks for taking the time to read that long post and answer my question. – 7stud Mar 07 '17 at 14:01
  • Any tips for how to actually type `Ctrl+X`. On a Mac keyboard there is no Ctrl key on the right hand side. To hit the Ctrl key consistently, I'm trying to learn the technique where you fold your pinky under and hammer down on the Ctrl key with your knuckle. – 7stud Mar 07 '17 at 14:09
  • I found a setting to make Caps Lock an extra Control key somewhere under keyboard preferences. Still no Control key on the right half of the keyboard, but it's easier to reach, so I find it good enough. – legoscia Mar 07 '17 at 14:12