| « Basic pointers on Latent Semantic Analysis and other semantic space models | Window switching in haskell-mode fixed » |
Edit: Thorsten Altenkirch pointed out that inferior-haskell-mode defines a defcustom inferior-haskell-find-project-root in addition to defining a function named the same thing. So the fix is actually to add the line ‘(inferior-haskell-find-project-root nil) in your ‘custom-set-variables. Ignore my advice to edit the inf-haskell.el.
I disabled haskell-mode 2.4’s code that changes the current directory after it detects your project root. I’m sure this works great if you have a Cabal project set up, but I don’t. So find the function inferior-haskell-load-file and comment out the unless clause after the comment “Not sure if it’s useful/needed and if it actually works". The author was suspicious of this code, and rightly so.
;; Go to the root of the Cabal project, if applicable.
(when (and inferior-haskell-find-project-root
(setq root (inferior-haskell-find-project-root buf)))
;; Not sure if it's useful/needed and if it actually works.
; Answer: No, it wasn't, and find-project-root doesn't work.
;(unless (equal default-directory root)
; (setq default-directory root)
; (inferior-haskell-send-command
; proc (concat ":cd " default-directory)))
The result from inferior-haskell-find-project-root is wrong and I don’t have time to fix the function. I’ll worry about fixing it when I’m retired, or when I start developing heaps of open source software in Haskell. Whichever comes first.
Note: my research code is notionally open source, but I’m too lazy to package it up in a cabal project. HOWEVER, I am going to put up an unfinished Research page today that links to my existing disorganised code. The links will not work, but you can click them anyway.