Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
(setq load-path (cons "/usr/lib/erlang/lib/tools-" 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)
(add-hook 'erlang-mode-hook 'my-erlang-mode-hook)
(require 'erlang-start)
(add-to-list 'load-path "~/.emacs.d/distel/elisp")
(require 'distel)
;; 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