[erlang-questions] erlang emacs mode question

Joe Armstrong <>
Thu Dec 17 21:39:38 CET 2009


Wow - amazing - thanks

/Joe

On Thu, Dec 17, 2009 at 9:15 PM, Martin Bjorklund <> wrote:
> Hi,
>
> Joe Armstrong <> 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"
>  (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 *("))))
>
> [ref: http://www.emacswiki.org/emacs/EasyCodeOutline]
>
>
>
> /martin
>


More information about the erlang-questions mailing list