Nick Daly writes: > After a bit of tinkering, I realized there are two things going on > here, only one of which I fully understand: > > 1. My core functional issue is that =comint-prompt-regexp= isn't set > up to handle the "Prelude| " entries or the repeated prompts. The > other patches I submitted were unnecessary. > > 2. The =comint-prompt-regexp= gets default values from somewhere I > don't understand and can't find with a quick source grep.
Here's what I can gather. inf-haskell used to set comint-prompt-regexp in the body of inferior-haskell-mode. Here's an example from 11d6abf (2017-08-24): (setq-local comint-prompt-regexp ;; Why the backslash in [\\._[:alnum:]]? "^\\*?[[:upper:]][\\._[:alnum:]]*\\(?: \\*?[[:upper:]][\\._[:alnum:]]*\\)*\\( λ\\)?> \\|^λ?> $") In ca94d81 (revamped inf-haskell, 2017-08-26), which was included in the v17.1 release, haskell-prompt-regexp was introduced and the line above is now (setq-local comint-prompt-regexp haskell-prompt-regexp) > In ob-haskell, we set =comint-prompt-regexp= to the (undefined) > haskell-prompt plus "or optional-lambda": With a haskell-mode after the commit I point to above, it shouldn't be undefined at the time we set comint-prompt-regexp because org-babel-interpret-haskell loads inf-haskell before that. However, I'm confused why Org's b46787743 (Fix ob-haskell.el to work with custom ghci prompts, 2017-12-02) added the λ bit (author of that patch cc'd). As far as I can tell, that is a part of inferior-haskell-mode's default comint-prompt-regexp and has been since 28997b2 (Add support for popular "λ> " prompt to inf-haskell, 2013-07-04). You've sent an updated patch in a follow-up message, so I'll continue there...