Guest User

Untitled

a guest
May 28th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. (let* ((env-output (shell-command-to-string "source .bashrc ; source .emacs.d/emacsenv.sh"))
  2. (lines (split-string env-output "[\r\n]+" t))
  3. (regex "^\\([^ ]+\\) \\(.*\\)$")
  4. (pairs (mapcar (lambda (line)
  5. (if (string-match regex line)
  6. (list (match-string 1 line) (match-string 2 line))))
  7. lines)))
  8. (mapc (lambda (pair) (apply 'setenv pair)) pairs))
Add Comment
Please, Sign In to add comment