Skip to content

Instantly share code, notes, and snippets.

@ionrock
Created June 10, 2015 19:35
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 ionrock/99e1b9dba0a772a2aa35 to your computer and use it in GitHub Desktop.
Save ionrock/99e1b9dba0a772a2aa35 to your computer and use it in GitHub Desktop.
(defun source-to-elisp (fname)
(with-temp-buffer
(insert-file fname)
(while (re-search-forward "^export \\(.*\\)=\\(.*\\)")
(let ((key (match-string 1))
(value (replace-regexp-in-string "\'\"" "" (match-string 2))))
(if (and key value)
(progn
(setenv key value)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment