Skip to content

Instantly share code, notes, and snippets.

@onlyshk
Created October 24, 2011 09:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onlyshk/1308700 to your computer and use it in GitHub Desktop.
Save onlyshk/1308700 to your computer and use it in GitHub Desktop.
(setq load-path (cons "/usr/lib/erlang/lib/tools-2.6.6.1/emacs" load-path))
(add-to-list 'auto-mode-alist '("\\.erl?$" . erlang-mode))
(add-to-list 'auto-mode-alist '("\\.hrl?$" . erlang-mode))
(setq erlang-root-dir "/usr/lib/erlang")
(add-to-list 'exec-path "/usr/lib/erlang/bin")
(setq erlang-man-root-dir "/usr/lib/erlang/man")
(defun my-erlang-mode-hook ()
(setq inferior-erlang-machine-options '("-sname" "emacs"))
(imenu-add-to-menubar "imenu")
(local-set-key [return] 'newline-and-indent)
(set-frame-height (selected-frame) 20))
(defun erl-shell (flags)
"Start an erlang shell with flags"
(interactive (list (read-string "Flags: ")))
(set 'inferior-erlang-machine-options (split-string flags))
(set-frame-height 5)
(erlang-shell))
(add-hook 'erlang-mode-hook 'my-erlang-mode-hook)
(require 'erlang-start)
(add-to-list 'load-path "~/.emacs.d/distel/elisp")
(require 'distel)
(distel-setup)
;; A number of the erlang-extended-mode key bindings are useful in the shell too
(defconst distel-shell-keys
'(("\C-\M-i" erl-complete)
("\M-?" erl-complete)
("\M-." erl-find-source-under-point)
("\M-," erl-find-source-unwind)
("\M-*" erl-find-source-unwind)
)
"Additional keys to bind when in Erlang shell.")
(add-hook 'erlang-shell-mode-hook (lambda ()
(dolist (spec distel-shell-keys)
(define-key erlang-shell-mode-map (car spec) (cadr spec)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment