Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Allow passing command line args to ghci #121

Closed
wants to merge 1 commit into from

4 participants

@ozataman

Manually overriding the haskell-process-path-ghci variable now allows
entries (among other things) like:

"/usr/bin/ghci -package-conf .cabal-sandbox/ghc-7.4.2-packages.conf.d"

This, for example, is a for-now work-around for cabal sandbox ghci support.

@ozataman ozataman Add basic support for passing command line arguments to ghci
Manually overriding the haskell-process-path-ghci variable now allows
entries (among other things) like:

"/usr/bin/ghci -package-conf .cabal-sandbox/ghc-7.4.2-packages.conf.d"
2928794
@gregorycollins gregorycollins commented on the diff
haskell-process.el
@@ -516,11 +516,15 @@ to be loaded by ghci."
process
(ecase haskell-process-type
('ghci
- (haskell-process-log (format "Starting inferior GHCi process %s ..."
- haskell-process-path-ghci))
- (start-process (haskell-session-name session)
- nil
- haskell-process-path-ghci))
+ (let ((cmd (car (split-string haskell-process-path-ghci " ")))
+ (args (cdr (split-string haskell-process-path-ghci " "))))
@gregorycollins Owner

Wouldn't it make more sense to have a separate haskell-process-args-ghci variable?

@ozataman
ozataman added a note
@chrisdone Owner

I'll make a haskell-process-args-ghci patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@chrisdone chrisdone closed this in d9474f8
@chrisdone
Owner

For what it's worth, I have also given up on the cabal-dev ghci which started throwing a silly error recently, and I didn't much like its behaviour anyway (loading all my modules on start up and things like that). So instead I just use the 'ghci mode and (earlier it was a local patch, now it's using this new args customization setting):

'(haskell-process-type 'ghci)
'(haskell-process-args-ghci '("-package-conf" "cabal-dev/packages-7.4.1.conf" "-i../dist/build/autogen" "-idist/build/autogen"))

Seems to suffice for me.

@ozataman

Perfect, thank you. Works for me too.

@chrisdone
Owner

You guys might be interested, I just started another mode: 3b36276

Gives you something like this: https://dl.dropbox.com/u/62227452/Screenshots/Screenshot%20from%202013-02-10%2001%3A18%3A54.png

Tomorrow I'll add some commands e.g. restart/clear/reset/purge for the process. I'm also thinking of implementing persistent projects somewhen so that when you first open Emacs, you run M-x haskell-menu or just put it in your .emacs and start projects from a buffer like this.

@gregorycollins

Nice!

@Mikolaj

+1 to persistent projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 9, 2013
  1. @ozataman

    Add basic support for passing command line arguments to ghci

    ozataman authored
    Manually overriding the haskell-process-path-ghci variable now allows
    entries (among other things) like:
    
    "/usr/bin/ghci -package-conf .cabal-sandbox/ghc-7.4.2-packages.conf.d"
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 5 deletions.
  1. +9 −5 haskell-process.el
View
14 haskell-process.el
@@ -516,11 +516,15 @@ to be loaded by ghci."
process
(ecase haskell-process-type
('ghci
- (haskell-process-log (format "Starting inferior GHCi process %s ..."
- haskell-process-path-ghci))
- (start-process (haskell-session-name session)
- nil
- haskell-process-path-ghci))
+ (let ((cmd (car (split-string haskell-process-path-ghci " ")))
+ (args (cdr (split-string haskell-process-path-ghci " "))))
@gregorycollins Owner

Wouldn't it make more sense to have a separate haskell-process-args-ghci variable?

@ozataman
ozataman added a note
@chrisdone Owner

I'll make a haskell-process-args-ghci patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ (haskell-process-log (format "Starting inferior GHCi process %s ..."
+ haskell-process-path-ghci))
+ (apply #'start-process
+ (haskell-session-name session)
+ nil
+ cmd
+ args)))
('cabal-ghci
(haskell-process-log (format "Starting inferior cabal-ghci process using %s ..."
haskell-process-path-cabal-ghci))
Something went wrong with that request. Please try again.