DanielG / ghc-mod

Happy Haskell Hacking for editors. DEPRECATED
Other
677 stars 175 forks source link

elisp: ghc-mod throws an error when visiting a file in a non-actual path. #319

Open pablocouto opened 10 years ago

pablocouto commented 10 years ago

Emacs allows to visit a new file in a non-actual path, suggesting to call make-directory before saving the new buffer. For a file with extension .hs, haskell-mode loads correctly in such a scenario; however, ghc-mod (which I have in the hooks for haskell-mode) fails. This is the error message when evaluating (ghc-init) for such a buffer:

Debugger entered--Lisp error: (error "No such directory found via CDPATH environment variable")
  signal(error ("No such directory found via CDPATH environment variable"))
  error("No such directory found via CDPATH environment variable")
  cd("/Users/personal/Haskell/nonExistent/")
  ghc-run-ghc-mod(("root"))
  ghc-get-project-root()
  ghc-with-process("check /Users/personal/Haskell/nonExistent/test.hs\n" ghc-check-callback #[nil "\301\211\207" [mode-line-process " -:-"] 2])
  ghc-check-syntax()
  ghc-init()
  eval((ghc-init) nil)
  eval-expression((ghc-init) nil)
  call-interactively(eval-expression nil nil)

I am using GNU Emacs 24.3.1 (x86_64-apple-darwin13.1.0, NS apple-appkit-1265.19), with ghc-mod version 4.1.6.

kazu-yamamoto commented 9 years ago

This issue is gone already. But we need to check this again when I implement map-file stuff.

DanielG commented 9 years ago

Ah, nice.

kazu-yamamoto commented 9 years ago

Sorry, I was confused. This issue still exits. And it's hard to fix it because Emacs process is binding to its working directory.