Erlang Development Environment windows + Emacs + distel Configuration

Source: Internet
Author: User

This article describes Erlang + Emacs + distel configuration in great detail, but there is no software download hyperlink. I made some modifications to it. For example, I use the latest software installation version. So I would offend the author and share it with you to save time.

 

Emacs + distel is the best combination of Erlang projects developed so far (I have heard of it too, so please accept it ). It is really painful to use editplus + Erlang syntax highlight plugin without stopping switching between windows and debugging. Google decided to configure an Emacs + distel environment. After the configuration, I tried the basic functions, which is quite helpful and advanced functions are not used yet. I will discuss it later.

My environment:
Windows xp pro SP2 + Erlang win32_r13b01 + EmacsW32-1.58 + distel-2009.03.06

 

1. First install Erlang and Emacs. The installation process is similar to that of common applications. To avoid the hassle of spaces in the path, do not include spaces (such as E:/erl5.7.2) in the installation path of Erlang ).

 

2. Configure the environment variable:
Erl_home = E:/erl5.7.2 add % erl_home %/bin to path
Home = E:/Erlang (this path is configured as the directory of the Erlang Project)

Decompress distel to E:/erl5.7.2/lib/distel-2009.03.06 (this path is free, easy to manage, put it under the Lib of Erlang)

Create an environment named ". emacs text file and content (the following path is adjusted based on your actual installation path, and the dark blue font is the adjusted object) are as follows:
; Erlang mode <br/> (setq load-path (Cons "E:/erl5.7.2/lib/tools-2.6.4/Emacs" load-path )) <br/> (setq Erlang-root-Dir "E:/erl5.7.2") <br/> (setq Exec-path (Cons "E: /erl5.7.2/bin "Exec-path) <br/> (require 'erlang-Start) </P> <p> ;; distel <br/> (LET (distel-Dir "E:/erl5.7.2/lib/tools-2.6.4/elisp ")) <br/> (unless (member distel-Dir load-path) <br/> (setq load-path (append load-path (list distel-Dir) <Br/> (require 'distel) <br/> (distel-Setup) </P> <p> ;; some Erlang mizmizations <br/> (add-hook 'erlang-mode-hook <br/> (lambda () <br/>; when starting an Erlang shell in Emacs, default in the node name <br/> (setq inferior-Erlang-machine-options' ("-sname" "Emacs") <br/> ;; add Erlang functions to an imenu menu <br/> (imenu-add-to-menubar "imenu") <br/>; A number of the Erlang-extended- Mode key bindings are useful in the shell too <br/> (defconst distel-shell-keys <br/> '("/C-/M-I" Erl-complete) <br/> ("/m -? "Erl-complete) <br/> ("/m -. "Erl-find-source-under-point) <br/> ("/m-, "Erl-find-source-Unwind) <br/> ("/m-*" Erl-find-source-Unwind) <br/> "additional keys to bind when in Erlang shell. ") <br/> (add-hook 'erlang-shell-mode-hook <br/> (lambda () <br/> ;; add some distel bindings to the Erlang shell <br/> (dolist (SPEC distel-shell-keys) <br/> (define-key Erlang-shell-mode-map (CAR spec) (CADR spec) </P> <p>

Do not forget to change the above path to your actual path. Note that the path separator is the forward slash "/" rather than the Backslash "/". In this way, the configuration files of Erlang mode and distel can be automatically loaded when Emacs is started.

 

3. Create a text file named ". Erlang. Cookie" in E:/Erlang (Environment Variable home). The content is random. For example:
It_is_a_secret_file
This file is the Magic cookie file of Erlang. Because distel needs to communicate with the running Erlang node, this step is indispensable.

 

4. finally, create an Emacs shortcut, and set it to "E: /Erlang "or" % home % "(home environment variable ). In this way, after Emacs is started, it can be directly located in the Erlang project directory.

 

Start Emacs and open an ERL file. You can see an additional "Erlang" menu, which contains a sub-menu of distel (note: if you do not open an ERL file, you cannot see the "Erlang" menu. I thought that the installation was not successful and it took two hours. Ah, I did not read the content carefully !) ,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Now, all environment configurations are complete.

The following is a good reference:

Bill clementson's blog: distel = Emacs Erlang-mode ++ (content mentions how to open the debugger window in the Emacs window) http://bc.tech.coop/blog/070528.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.