literate haskell (again)

Jan-Willem Maessen
Fri, 22 Mar 2002 11:31:32 -0500

Jorge Adriano <> writes:
> Tried using Andrew Cookes haskell.sty and liked it a lot, but seems like the 
> (X)emacs haskell mode doesn't support the \begin{code} \end{code}  literate 
> programming style, just the one where code is preceded by '> '.
> Anyone has got an hack available for this?

According to my haskell-mode.el:

;; Default literate style for ambiguous literate buffers.
(defvar haskell-literate-default 'bird
  "*If the style of a literate buffer is ambiguous, then this variable
gives the default value for `haskell-literate'.  This variable should
be set to the preferred literate style.  For example, place within

   (setq haskell-literate-default 'latex)")

So you probably want to change this as per the instructions.

I use Ralf Hinze's lhs2TeX and an ancient version of the Utrecht
attribute grammar tool, and have therefore hacked my haskell-mode.el
to do the appropriate thing with the other literate code markers for
both of these files:

(defvar haskell-latex-begin
  "Regexp distinguishing start of LaTeX code regions.")
(defvar haskell-latex-start
  "Regexp distinguishing just LaTeX start text.")
(defvar haskell-latex-end
  "Regexp distinguishing end of LaTeX code regions.")
(defvar haskell-latex-finish
  "Regexp distinguishing just LaTeX end text.")
(defvar haskell-latex-boundary
  "Regexp finding boundaries in LaTeX code")

-Jan-Willem Maessen