
Jorge Adriano
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: ------------snip ;; 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 .emacs: (setq haskell-literate-default 'latex)") ------------snip 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: ------------snip (defvar haskell-latex-begin "^\\\\\\(begin{code}$\\|begin{spec}$\\|BC$\\|BT{.*}$\\)" "Regexp distinguishing start of LaTeX code regions.") (defvar haskell-latex-start "\\\\\\(begin{code}\\|begin{spec}\\|BC\\|BT{.*}\\)" "Regexp distinguishing just LaTeX start text.") (defvar haskell-latex-end "^\\\\\\(end{code}$\\|end{spec}$\\|EC$\\|ET$\\)" "Regexp distinguishing end of LaTeX code regions.") (defvar haskell-latex-finish "\\\\\\(end{code}\\|end{spec}\\|EC\\|ET\\)" "Regexp distinguishing just LaTeX end text.") (defvar haskell-latex-boundary "^\\\\\\(\\(begin{code}$\\|begin{spec}$\\|BC$\\|BT{.*}$\\)\\|\\(end{code}$\\|end{spec}$\\|EC$\\|ET$\\)\\)" "Regexp finding boundaries in LaTeX code") ------------snip -Jan-Willem Maessen

On Friday 22 March 2002 16:31, you wrote:
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: (...)
So you probably want to change this as per the instructions.
Seems like it was not a .emacs (in fact .init.el here) problem. I just noticed that if you got to add a line break *right after* the \begin{code} and right after the \end{code} If you add a space after the '{code}' it will not toggle comment/code modes. Where should I report this bug? Since I'm on haskell-mode bugs, when typing "undefined" in xemacs I get "(1) (error/warning) Error in `post-command-hook' (setting hook to nil): (wrong-type-argument listp a )" Thanks, J.A.
participants (2)
-
Jan-Willem Maessen
-
Jorge Adriano