Skip to content

Instantly share code, notes, and snippets.

@ziz
Created October 2, 2012 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ziz/34b59137063404db0f56 to your computer and use it in GitHub Desktop.
Save ziz/34b59137063404db0f56 to your computer and use it in GitHub Desktop.
(defun read-lines (file)
"Return a list of lines in FILE."
(with-temp-buffer
(insert-file-contents file)
(split-string
(buffer-string) "\n" t)
) )
(defun jdv-split-path-from-file (lines)
(let ((linelist (if (listp lines) lines (list lines)) ))
(split-string (car linelist) ":" t)))
(let ((path-file (expand-file-name "~/.emacs_path")))
(when (file-exists-p path-file)
(setenv "PATH"
(mapconcat 'identity
(delete-dups
(append
(jdv-split-path-from-file (read-lines path-file))
(split-string (getenv "PATH") ":" t))) ":"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment