-
Notifications
You must be signed in to change notification settings - Fork 347
Add support for tying repl/ghci/cabal-dev process type to project #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
to understand your situation better: in which cases do you use plain |
You are right that we now have cabal repl as the single entry point for all cabal supported projects. I think the question is identical to where you would use ghci directly vs. cabal repl. My answer is that I use ghci for self-standing scripts or programs that don't yet have a full cabal package definition. I use cabal repl for everything else, which recently made this issue less of a problem for me. Before cabal repl with sandbox support, it was a nightmare as using sandbox vs. using system-global packages needed different haskell-process-types. I'm not sure but others might also have cases where they are still using cabal-dev, although I personally don't see why not everyone would migrate their cabal-dev sandbox to cabal. Nevertheless, I still deal with a lot of stand-alone applications (for one-off computations, etc.) that this does get from time to time annoying. I think the general realization is that the decision of haskell-process-type is less globally-determined and more per-project determined. |
The reason I'm asking is that I had planned to implement something like
This is would be similiar to how Would that cover your use-cases? Can you think of cases where when this kind of auto-detection would fail? |
Sorry for the late answer here. That actually sounds pretty good. If we It might still be good to leave a pressure valve in place for any other On Thu, Sep 12, 2013 at 3:01 AM, Herbert Valerio Riedel <
|
Well, the code-base would greatly benefit if we would rip out all the quirks for supporting everything but |
Following up from a few months ago and having thought about this during that time, I had a couple of comments on this thread:
Hope we get this soon! I would go ahead and do it myself if I were better acquainted with eLisp. |
You can use .dir-locals.el, perhaps. Example, in your project directory make ((haskell-mode . ((haskell-process-type . ghci)))
(cabal-mode . ((haskell-process-type . ghci)))) Now any buffer you open in that directory will have this variable set as |
This can now probably be considered done, due to a change I just committed: When haskell-process-type is set to 'auto (the new default), then the presence of a *.cabal file or a .cabal-sandbox directory in a parent directory will cause cabal-repl to be used. Otherwise, ghci will be used. This is in accordance with the suggestions above. |
Hey @ozataman, I'm going to close this ticket, but if you still need to be able to specify a different cabal target in your |
Perhaps a file like .haskell-process-type can be read per project root to determine what type should be used prior to checking the current global variable.
I often have 3-4 projects open at the same time, some depending on cabal repl and some using the plain ghci. I ended up creating "haskell-process-cabal" "haskell-process-ghci" functions I call using M-x to flip the global variable, which feels like a sub-par solution. It gets real annoying when you have to haskell-process-restart.
The text was updated successfully, but these errors were encountered: