GithubHelp home page GithubHelp logo

Comments (10)

chrisdone avatar chrisdone commented on May 16, 2024

Where are you putting the .ghci file? Try with:

.ghci:

putStrLn ".ghci works!"

In the same directory as your .cabal file. Then when you start the process, have a look in the *haskell-process-log* buffer and do a search for β€œ.ghci works”, it should be in there. If not, seems your ghci or cabal-dev differs to mine in some way. Which would be surprising, but we would need to address that with some elisp-level configuration as you suggest. Let me know.

from haskell-mode.

vagifverdi avatar vagifverdi commented on May 16, 2024

My .ghci works fine. Putting command line in it does not work (probably not supported ?) I tried outside of emacs.
:set -Llib -lpdf
has no effect.

And yes, putStrLn ".ghci works!", fires up fine.

from haskell-mode.

chrisdone avatar chrisdone commented on May 16, 2024

Ah, I understand. The -L and -l have no effect from the .ghci file, though everything else in the .ghci file runs.

How would you like to specify project-specific options to the inferior Haskell process?

from haskell-mode.

vagifverdi avatar vagifverdi commented on May 16, 2024

Perhaps when it starts asking questions about cabal folder etc. one of the questions could be ghci arguments. With default (enter) nothing. One thing though, params must be a list, not a string.

I made it work like this: haskell-process.el

(defcustom haskell-process-ghci-args nil
"Args for ghci"
:group 'haskell
:type '(choice string (repeat string)))

and then

(apply 'start-process (haskell-session-name session)
nil
haskell-process-path-ghci haskell-process-ghci-args)

and in my init file:

(custom-set-variables
'(haskell-process-ghci-args (list "-Llib" "-lpdf"))
)

but this is global, not per project.

I tried to pass one string "-Llib -lpdf". But that does not work. It must be a list.
I do not know how you gonna do it. Take one string and then split it by spaces, or repeatedly ask arguments until the first empty one.

from haskell-mode.

vagifverdi avatar vagifverdi commented on May 16, 2024

Even better would be to fix cabal to accept -L -l from .ghci.

from haskell-mode.

chrisdone avatar chrisdone commented on May 16, 2024

You mean GHCi?

from haskell-mode.

vagifverdi avatar vagifverdi commented on May 16, 2024

ah yes :) ghci

from haskell-mode.

vagifverdi avatar vagifverdi commented on May 16, 2024

actually here's the thing. I already have these options in .cabal file. I'm not sure if you are reading them and passing them to ghci. But if you are maybe you can read these options form cabal file :
extra-lib-dirs: lib
extra-libraries: pdf

This would be ideal, no need for extra questions.

from haskell-mode.

chrisdone avatar chrisdone commented on May 16, 2024

cabal-dev ghci should handle that. Does it not?

from haskell-mode.

vagifverdi avatar vagifverdi commented on May 16, 2024

i do not use cabal-dev. hmm perhaps i should.

from haskell-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.