[Haskell-cafe] Code folding in Emacs
johan.tibell at gmail.com
Mon Jan 14 11:38:57 EST 2008
On Jan 14, 2008 2:30 PM, Valery V. Vorotyntsev <valery.vv at gmail.com> wrote:
> On 1/14/08, Johan Tibell <johan.tibell at gmail.com> wrote:
> > It would be pretty neat for Haskell hacking if the Emacs Haskell mode
> > could do the following. Imagine you have written some code like so:
> > [...]
> > Binding a haskell-fold-source function to a key chain would enable you
> > to get a quick overview of your module showing only the comments and
> > type signatures. I've used the little function from
> > http://emacs.wordpress.com/2007/01/16/quick-and-dirty-code-folding/
> > but it doesn't work well together with indented type signatures like
> > in the example above.
> AFAIU the problem, ..
> data StupidTypeNameIntendedToBeLong =
> functionWithLoooongName :: Foo
> -> Bar
> functionWithLoooongName = undefined
> .. you don't like the way haskell-mode indents the `-> Bar' line.
> If this is the case, you could `newline-and-indent' (`C-j') right
> after `::'.
No, I like the way haskell-mode indents. :)
However the simple folding snippet I linked to above doesn't work with
it since that code simple collapses everything that's indented.
More information about the Haskell-Cafe