-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix annoying PATH loading issue introduced in some random OSX update
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
;; At some point a Lion update broke loading PATH from | ||
;; environment.plist. Thanks to jwiegley for this little elisp gem to | ||
;; load the file manually. | ||
;; | ||
;; Source: https://github.com/jwiegley/dot-emacs/blob/master/init.el | ||
|
||
(when rdj-is-mac | ||
(let ((plist (expand-file-name "~/.MacOSX/environment.plist"))) | ||
(when (file-readable-p plist) | ||
(let ((dict (cdr (assq 'dict (cdar (xml-parse-file plist)))))) | ||
(while dict | ||
(if (and (listp (car dict)) | ||
(eq 'key (caar dict))) | ||
(setenv (car (cddr (car dict))) | ||
(car (cddr (car (cddr dict)))))) | ||
(setq dict (cdr dict)))) | ||
|
||
;; Configure exec-path based on the new PATH | ||
(setq exec-path nil) | ||
(mapc (apply-partially #'add-to-list 'exec-path) | ||
(nreverse (split-string (getenv "PATH") ":")))))) | ||
|
||
(provide 'rdj-fix-path) | ||
|