pheaver/haskell-mode — Issue #5: haskell-mode hangs when a preprocessor encounters an error
Author: stepcut
Created: 2011-12-20 15:34:09+00:00
State: open

If you are using a pre-processor (e.g. {-# OPTIONS_GHC -F -pgmFtrhsx #-}) and the pre-processor encounters an error, then the GHCi prompt is just a > at the beginning of the line. For example,

Prelude> :load "autocomplete/Main.hs"

autocomplete/Main.hs:24:1: Parse error: ;
phase `Haskell pre-processor' failed (exitcode = 1)
>

The fix is to extend comint-prompt-regexp with "\\|^> $". Without this patch, things like C-c C-l stop working and just hang.

hunk ./inf-haskell.el 131
- "^\\*?[[:upper:]][\\._[:alnum:]]*\\(?: \\*?[[:upper:]][\\._[:alnum:]]*\\)*> ")
+ "^\\*?[[:upper:]][\\._[:alnum:]]*\\(?: \\*?[[:upper:]][\\._[:alnum:]]*\\)*> \\|^> $")