Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How do I enter erlang mode in emacs to get code highlighting, etc.? Whenever I open an erlang file nothing special happens. Do I need to change something in my .emacs file, or do I need to add a module to emacs, or something else?

share|improve this question

2 Answers 2

As of 22 March 2013, the Erlang mode is installable through the MELPA package archive. If you haven't done so already, activate MELPA by putting the following in your .emacs:

(add-to-list 'package-archives
  '("melpa" . "http://melpa.milkbox.net/packages/") t)

Then hit M-x list-packages and install the erlang package.

share|improve this answer

Emacs doesn't come with an Erlang mode, so you need to add one. Erlang itself appears to ship with an Emacs mode that you can use; there are instructions on installing it and using it on their website, but it comes down to just adding their folders to your load path and exec path, setting a variable, and requiring the module:

(setq load-path (cons  "/usr/local/otp/lib/tools-<ToolsVer>/emacs" load-path))
(setq erlang-root-dir "/usr/local/otp")
(setq exec-path (cons "/usr/local/otp/bin" exec-path))
(require 'erlang-start)

The paths might be different depending on where you installed Erlang

share|improve this answer
    
thanks. how do i find where otp is installed? is there an erl command for it? –  B_R Sep 10 '11 at 17:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.