Thanks a bunch, Nils!&nbsp; Your elisp code works great for me.&nbsp; No more manual switching between LaTeX and literate Haskell modes.&nbsp; <br><br>The one visible shortcoming is that it doesn't handle inline Haskell (|...| or @...@).&nbsp; I see you added support but commented it out.&nbsp; When I tried it myself, I see why.&nbsp; Apparently, closing delimiters are also treated as opening delimiters, so the whole paragraph after the first &quot;|&quot; or &quot;@&quot; ends up treated as Haskell code.&nbsp; Maybe it's impossible to fix this problem, since distinguishing between open and close delimiter is not lexical.&nbsp; Since inline Haskell coloring is not nearly as useful as code block coloring, this problem is fortunately not too big a deal.&nbsp; Still, I'm curious if anyone has a solution.
<br><br>Regards,<br><br>- Conal<br>