haskell/haskell-mode — pull request #84 by boothead (2012-09-18 16:09:17+00:00)
Title: Virthualenv integration

I had some problems with a snap project and the code reloading under cabal-dev so I've had a stab at getting virthualenv working with haskell-mode. I've got the basics of virthualenv integration in this pull request. It's pretty alpha (and it's also the first elisp I've written) so I'd like to ask for some help to get it up to scratch.

At the moment you use it like this:

Set the virthaulenv on the current session
`M-x haskell-process-ve`

This prompts you for the virthualenv location and attempts to find it much like setting the .cabal file location. **Note** You have to already have a `haskell-session` for this to work.

You can then activate the virthualenv with
`M-x haskell-virthualenv-activate`

After you've done this the prompt in interactive mode looks like
`(snap) λ>`

`haskell-process-type` has to be ghci. It would seem to make sense to enforce or set this when activating the virthualenv but I wasn't sure if there's a use case for cabal-dev *within* a virthualenv so I haven't done anything about that yet.

### ISSUES
* I couldn't quite see how to set the prompt in the interactive mode straight away - the `()` only appears after I've run the first command in the interactive window
* Should it be a minor mode?
* The `haskell-process-ve` only seems to be available after I've run `C-c C-l` to get a session. I assume that this is due to the autoloading? It would be nice to have a better way to set the virthualenv up initially.
* No integration with `haskell-process-start` as yet. I wanted to keep touching other files to a minimum initially, but I think it would make more sense to work the presence of a virthualenv on the session impact on what's passed to `haskell-process-set-process` inside `haskell-process-start`