Skip to content

Instantly share code, notes, and snippets.

@plediii
Forked from wfarr/global.el
Created December 10, 2008 00:22
Show Gist options
  • Save plediii/34161 to your computer and use it in GitHub Desktop.
Save plediii/34161 to your computer and use it in GitHub Desktop.
(defun prepend-to-path (&rest paths)
(map 'nil (lambda (path)
(let ((old-paths (getenv "PATH")))
(if (and old-paths (not (equal old-paths "")))
(if (not (member path (split-string old-paths ":")))
(setenv "PATH" (concat path ":" old-paths)))
(setenv "PATH" path)))
(if (not (member path exec-path))
(setq exec-path (cons path exec-path))))
(reverse (prune-directory-list paths)))
exec-path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment