public
Created

  • Download Gist
gistfile1.el
Emacs Lisp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
(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)))))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.