32 lines
1014 B
EmacsLisp
32 lines
1014 B
EmacsLisp
;;; 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 (concat user-emacs-directory "/modules/lib/"))
|
|
|
|
;; 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 (concat user-emacs-directory "/modules/lib/myemacs.el"))
|
|
|
|
(provide 'init-utils)
|
|
;;; init-utils.el ends here
|