Commits

R Primus  committed 0f43a7b

add outline mode to erlang

  • Participants
  • Parent commits 0101d32

Comments (0)

Files changed (1)

File .emacs.d/rprimus.el

 (add-to-list 'load-path  "/usr/local/lib/erlang/lib/wrangler-1.0/elisp")
 (require 'wrangler)
 
+; Sun Nov 18 20:13:55 UTC 2012 -primus
+; http://erlang.org/pipermail/erlang-questions/2009-December/048465.html
+(defun show-onelevel ()
+  "show entry and children in outline mode"
+  (interactive)
+  (show-entry)
+  (show-children))
+
+(defun my-outline-bindings ()
+  "sets shortcut bindings for outline minor mode"
+  (interactive)
+  (local-set-key [C-up] 'outline-previous-visible-heading)
+  (local-set-key [C-down] 'outline-next-visible-heading)
+  (local-set-key [C-left] 'hide-subtree)
+  (local-set-key [C-right] 'show-onelevel))
+
+(add-hook
+ 'outline-minor-mode-hook
+ 'my-outline-bindings)
+
+(add-hook
+ 'erlang-mode-hook
+ '(lambda ()
+    (outline-minor-mode)
+    (setq outline-regexp
+            (concat "^-?" erlang-atom-regexp "\\s *("))))
+
+
+
  ; Thu Nov  1 21:24:17 GMT 2012 -primus
  ; from http://bc.tech.coop/blog/070528.html
 (require 'distel)