diff options
author | Jesús <heckyel@hyperbola.info> | 2019-01-22 15:45:41 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2019-01-22 15:45:41 -0500 |
commit | ced0fe8f9ef7cd16ade900bb34393c627f6d0c69 (patch) | |
tree | 350d3a0cbb87b12a36c0dc12537c56a75a2668ae /modules/init-utils.el | |
parent | d0f44d85466d7211d54e30970f29815842ff4180 (diff) | |
download | emacs-personal-ced0fe8f9ef7cd16ade900bb34393c627f6d0c69.tar.lz emacs-personal-ced0fe8f9ef7cd16ade900bb34393c627f6d0c69.tar.xz emacs-personal-ced0fe8f9ef7cd16ade900bb34393c627f6d0c69.zip |
Change directory lisp/ to modules/
FS #2
Diffstat (limited to 'modules/init-utils.el')
-rw-r--r-- | modules/init-utils.el | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/init-utils.el b/modules/init-utils.el new file mode 100644 index 0000000..ffcdd9f --- /dev/null +++ b/modules/init-utils.el @@ -0,0 +1,31 @@ +;;; init-utils.el --- .Emacs Configuration -*- lexical-binding: t -*- +;;; Commentary: +;; + +;;; Code: +;; Loads functions from libs +(defun load-directory (dir) + "Load functions from the libs DIR. +read the .el files" + (let ((load-it (lambda (f) + (load-file (concat (file-name-as-directory dir) f))) + )) + (mapc load-it (directory-files dir nil "\\.el$")))) + +;; Load lib functions +(load-directory (expand-file-name "~/.emacs.d/modules/lib/" user-emacs-directory)) + +;; This is borrowed from https://github.com/purcell/emacs.d/blob/master/lisp/init-utils.el by Steve Purcell but I have added some stuff. +(if (fboundp 'with-eval-after-load) + (defalias 'after-load 'with-eval-after-load) + (defmacro after-load (feature &rest body) + "After FEATURE is loaded, evaluate BODY." + (declare (indent defun)) + `(eval-after-load, feature + '(progn ,@body)))) + +;; Elapsed time +(load-file "~/.emacs.d/modules/lib/myemacs.el") + +(provide 'init-utils) +;;; init-utils.el ends here |