How to configure Erlang + Emacs using erlang.el?

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

I read the Erlang / OTP R13B04 Documentation and Erlang Mode for Emacs documentation , but I did not find any information on how to configure it.

UPDATE 1: I found additional documentation on Erlang Mode for Emacs . I typed a 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 what my .emacs looks like. It was 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 just tried on a different computer, Windows 7, GNU Emacs 23.1.50.1 .emacs file is located in 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 introduce Mx erlang-version in Emacs, I get this message: [No match]

+4
source share
3 answers

One way to see if your .emacs being used is to temporarily move your version, go to Emacs and change some settings (for example, the default font), and then click Save Settings in the Options menu. This will create a .emacs file for you.

It may be in the same place, or Emacs may decide to place it somewhere else. Find out where it is and add your settings there. The installation must be restarted upon restart.

If you get the erlang-skels.el error message (since it really is in some R13B releases), I would suggest installing erlware-mode instead ( download the zip here ). Put it in your .emacs.d folder and change the boot path value you added to point to this directory. This is a much more complete and corrected mode with improved indentation, among other things.

Your erlware-mode configuration should look like this (if you put the files in erlware mode in the erlware-mode folder in .emacs.d ):

 (setq load-path (cons "C:/Users/Jonas/.emacs.d/.emacs/erlware-mode" 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) 
+3
source

You can see my article on Emacs and Erlang . The standard way is to place erlang.el somewhere and load it using the load command. From my point of view, it is better to use erlware-mode, since it contains some extensions over the standard erlang-mode. You can see my erlang configuration here . It works under windows, but you need to check what value the variable env% HOME% has - the "~" sign is expanded into this value.

+5
source

Are you sure there is an erlang-start.el in C:/Program Files (x86)/erl5.7.1/lib/tools-2.6.4/emacs ? Perhaps you should change tools-2.6.4 to another name, find out what is the name in your erlang path.

+3
source

Source: https://habr.com/ru/post/1308934/


All Articles