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