[erlang-questions] erlang emacs mode question
Thu Dec 17 21:39:38 CET 2009
Wow - amazing - thanks
On Thu, Dec 17, 2009 at 9:15 PM, Martin Bjorklund <mbj@REDACTED> wrote:
> Joe Armstrong <erlang@REDACTED> wrote:
>> What I'd like is "org mode erlang editing"
>> hit tab on the first line of a function definition hides or reveals
>> the body of the function.
>> hit meta-uparrow on the first line of a function move the function up
>> in the file.
> You can configure outline mode to do this, sort of. Put this in
> .emacs. Instead of <tab> as you suggested, use C-left / C-right.
> This way it shows / hides each function clause as a separate item, but
> you probably want to treat the complete function as one entity. I'm
> sure it is doable...
> (defun show-onelevel ()
> "show entry and children in outline mode"
> (defun my-outline-bindings ()
> "sets shortcut bindings for outline minor mode"
> (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))
> '(lambda ()
> (setq outline-regexp
> (concat "^-?" erlang-atom-regexp "\\s *("))))
> [ref: http://www.emacswiki.org/emacs/EasyCodeOutline]
More information about the erlang-questions