Created
December 29, 2015 03:27
-
-
Save emanon-was/0fe0e52a5b9ab0347c1d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ;;----------------------------- | |
| ;; Load *.config.el | |
| ;;----------------------------- | |
| (defvar loaded-config '()) | |
| (defun config-el-p (conf) | |
| (string-match "\\.config\\.el$" conf)) | |
| (defun loaded-config-p (conf) | |
| (if (config-el-p conf) | |
| (member conf loaded-config) | |
| nil)) | |
| (defun load-config-file (conf) | |
| (if (and (config-el-p conf) | |
| (not (loaded-config-p conf))) | |
| (progn | |
| (load conf) | |
| (setq loaded-config | |
| (nconc loaded-config | |
| (list conf)))))) | |
| (defun load-config-directory (path) | |
| (let* ((path (expand-file-name path)) | |
| (files (directory-files path))) | |
| (dolist (x files) | |
| (load-config-file x)))) | |
| (defun load-configs (path) | |
| (load-config-directory | |
| (locate-user-emacs-file path))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment