purcell/exec-path-from-shell — pull request #1 by lunaryorn (2012-09-13 19:08:47+00:00)
Title: Make parsing more reliable

`exec-path-from-getenv` isn't reliable, because it assumes that the `$PATH` is the only output of the subprocess. A shell however may emit more output from the user's shell configuration files, i.e. a welcome message from `fortune` or something the like of. In such cases, `exec-path` and `$PATH` are spoiled and become useless, because arbitrary strings end up there.

This patch is my attempt to fix this short-coming. I insert a marker string (`__RESULT=`) into the `echo` command, and search the output of the subprocess for this marker.

I've also replaced `shell-command-to-string` with a direct call to `call-process` because it's somewhat absurd to use a shell to spawn the shell ;)