emacs: Rework configuration

This commit is contained in:
caem 2025-02-21 17:28:19 +01:00
parent 79bb2f7c9c
commit 0abac2afd1
Signed by: caem
GPG key ID: 69A830D03203405F
20 changed files with 105 additions and 113 deletions

View file

@ -0,0 +1,13 @@
(provide 'rei)
(defun rei/load (path)
"Load a configuraion file relative to the current file.
When the specified path is a directory it will look for a init.el file to load."
(when load-file-name
(let ((fp (file-name-concat (file-name-directory load-file-name) path)))
(if (file-directory-p fp)
(let ((fdp (file-name-concat fp "init.el")))
(if (file-exists-p fdp)
(load fdp)
(error "Cannot load %s directory as it's missing an init.el file." path)))
(load fp)))))