Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up Erlang + Emacs with erlang.el?

I have downloaded and installed Erlang and EmacsW32. But how do I use erlang.el in Emacs? Where do I place it or install it?

I have read Erlang/OTP R13B04 documentation and Erlang mode for Emacs documentation but I haven't found any information about how to set up it.

UPDATE 1: I have found more documentation on The Erlang mode for Emacs. I have typed in the script in my .emacs, but I get File error: Cannot open load file, erlang-start when I start Emacs, so something is wrong.

UPDATE 2: This is how my .emacs look like. It's taken directly from the link above.

(setq load-path (cons "C:/Program Files (x86)/erl5.7.1/lib/tools-2.6.4/emacs"
load-path))
(setq erlang-root-dir "C:/Program Files (x86)/erl5.7.1")
(setq exec-path (cons "C:/Program Files (x86)/erl5.7.1/bin" exec-path))
(require 'erlang-start)

UPDATE 3: I have now tried on another computer, Windows 7, GNU Emacs 23.1.50.1 The .emacs file is located at C:\Users\Jonas\.emacs.d\.emacs with this content:

(setq load-path (cons "C:/Program Files (x86)/erl5.7.5/lib/tools-2.6.5.1/emacs" 
load-path))
(setq erlang-root-dir "C:/Program Files (x86)/erl5.7.5")
(setq exec-path (cons "C:/Program Files (x86)/erl5.7.5/bin" exec-path))
(require 'erlang-start)

When I try to type M-x erlang-version in Emacs, I get this message: [No match]

like image 868
Jonas Avatar asked Dec 23 '22 03:12

Jonas


1 Answers

You could look to my article about Emacs & Erlang for details. Standard way is to put erlang.el somewhere, and load it explicitly with load command. From my point of view it's better to use erlware-mode, as it contains some extensions over standard erlang-mode. You can see my erlang config here. It works under windows, but you need to check which value have env variable %HOME% - the '~' sign is expanded into it value.

like image 136
Alex Ott Avatar answered Dec 24 '22 17:12

Alex Ott