Skip to content

Instantly share code, notes, and snippets.

@dreid
Created January 14, 2011 07:41
Show Gist options
  • Save dreid/779324 to your computer and use it in GitHub Desktop.
Save dreid/779324 to your computer and use it in GitHub Desktop.
(defun add-to-PATH (dir)
"Add the specified path element to the Emacs PATH"
(interactive "DEnter directory to be added to PATH: ")
(if (file-directory-p dir)
(setenv "PATH"
(concat (expand-file-name dir)
path-separator
(getenv "PATH")))))
(defun activate-virtualenv (dir)
(setenv "VIRTUAL_ENV" dir)
(add-to-PATH (concat dir "/bin"))
(add-to-list 'exec-path (concat dir "/bin")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment