serras / emacs-haskell-tutorial

Tutorial on setting up Emacs to do Haskell programming
690 stars 100 forks source link

Make paths for calling cabal executables more robust #17

Closed dpkatz closed 9 years ago

dpkatz commented 9 years ago

The current document suggests adding path elements like ~/.cabal/bin (a.k.a. "tilde-paths") to the PATH environment variable and the exec-path variable. I had some trouble with this when using zsh as my default shell -- in particular, efforts to call hoogle locally would error out with the message:

zsh:1: command not found: hoogle

There were no such problems when I used bash as my default shell.

A reasonably robust solution to this problem is to wrap tilde-path elements like this in a call to expand-file-name, which will expand them to absolute paths - a situation which I'd expect every shell to handle properly. (I've tested with both bash and zsh and they, at least, have no problem with this.)

serras commented 9 years ago

Thanks for the help! I have also updated the dot-emacs.el example file to include a call to expand-file-name.