If I do:
(getenv "PATH")
I get a list of colon-separated directories, including:
/Users/michaeln/Library/Haskell/bin
If I look at the exec-path variable, I see a list including the same directory. If I do:
(shell-command "echo $PATH")
I get a list of colon-separated directories including the same Haskell/bin directory as above. There is an executable pandoc in that directory. And yet, if I do:
(shell-command "pandoc")
I get in response:
/bin/bash: pandoc: command not found
What am I doing wrong?
pandocis located to yourexec-path: http://emacswiki.org/emacs/ExecPath – lawlist Apr 08 '15 at 05:46pandocfrombashshell prompt? – Saravana Apr 08 '15 at 05:53exec-pathvariable...". – Michael Norrish Apr 08 '15 at 05:57M-x shelland typepandoc --version, or if I run my usual shell within Terminal.app. – Michael Norrish Apr 08 '15 at 05:58exec-pathis only relevant to binaries Emacs wants to run. In this instance Emacs is running a shell (and the shell is running pandoc), so I believe there's no particular reason in this case for pandoc to be accessible fromexec-path. – phils Apr 08 '15 at 07:35which pandocreport from the shell? – phils Apr 08 '15 at 07:38PATHvariable? – wvxvw Apr 08 '15 at 12:09../Haskell/bindirectory to your path? my guess is that it is getting added dynamically for interactive shells, which(shell-command)is not considered by default. does it work if you set the following:(setq shell-command-switch "-ic")? – waymondo Apr 08 '15 at 14:06PATHfrom the shell where it's run. If, for instance, op hasexport PATH=$PATH:~/Haskell/binin his.bashrc, but runs Emacs from, say, a desktop icon, it may not inherit the proper path. – nanny Apr 08 '15 at 14:11(getenv "PATH")returns the directory I want. Nonetheless, I think @waymondo is right: theHaskell/bindirectory is added interactively, not for non-interactive shells. – Michael Norrish Apr 10 '15 at 03:34