Created
April 26, 2013 23:01
-
-
Save dougbeal/5471004 to your computer and use it in GitHub Desktop.
Cross platform .emacs file to load configuration from repository
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
(require 'cl) | |
(defun load-init-file () | |
(let* ( | |
(user (getenv "USER")) | |
(repo "/git/home") | |
(locations | |
(list | |
(concat "/Users/" user repo) | |
(concat "/home/" user repo) | |
(concat "C:/cygwin/home/" user repo ) | |
)) | |
(path nil) | |
) | |
(catch 'break | |
(loop for location in locations | |
do | |
(setq path (concat location "/emacs/init.el")) | |
(add-to-list 'load-path path) | |
(if (load path t) | |
(throw 'break path) | |
(message (concat "Load failed " path)) | |
) | |
) | |
) | |
) | |
) | |
(message (concat "load-init-file:" (if (load-init-file) "Succeeded" "Failed"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment