sergv / dotemacs

emacs config
2 stars 0 forks source link

Indentation in mmm-haskell blocks #1

Open cxandru opened 3 years ago

cxandru commented 3 years ago

Hi, I thought this might be the best way to reach you. Does indentation work properly in your mmm-mode setup for lhs2latex literate Haskell? I happen to be writing a beamer presentation about recursion schemes (with multiply recursive data), indentation isn't working for me (as this blog post (albeit from 2009) warns https://sixthhappiness.github.io/articles/haskell-literate-programming-pandoc-carbon-xemacs/index.html).

So before I copy your setup I would just like to know if indentation works.

sergv commented 3 years ago

Indentation doesn't really work. .lhs file opens in latex mode and switches to haskell mode within \begin{code} ... \end{code} blocks, but not all haskell mode keybindings get enabled there for some reason, including indentation one.

If you wanted to use Bird-style literate programming then I was unable to get vanilla haskell mode to support it satisfactorily enough.

I can think of an easy-ish way to edit both latex and haskell parts by having two buffers side by side via indirect buffers. One will run in latex-mode where you can edit latex without pain, the other will run literate-haskell-mode that seems to have haskell indentation working so you can edit code snippets there.