summaryrefslogtreecommitdiff
path: root/emacs/early-init.el
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2021-11-14 12:16:55 +0000
committerGrégoire Duchêne <gduchene@awhk.org>2021-11-14 12:16:55 +0000
commit04eea33381d8ba2c4f09eed614194e3155459136 (patch)
tree04877572f8e4c8d875410b6d4d3d2c189811011a /emacs/early-init.el
parent2d7b31e177fb2fe7beaa8bf35b3f1f2655885009 (diff)
emacs: s!source-if-exists!my/source-if-exists!
Diffstat (limited to 'emacs/early-init.el')
-rw-r--r--emacs/early-init.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/emacs/early-init.el b/emacs/early-init.el
index edead3f..de5c85a 100644
--- a/emacs/early-init.el
+++ b/emacs/early-init.el
@@ -1,3 +1,8 @@
+(defun my/source-if-exists (filename)
+ "Load FILENAME if it exists within the dotfiles hierarchy."
+ (load (concat (file-truename user-emacs-directory) "../"
+ (substitute-in-file-name filename)) :no-error))
+
(setq default-frame-alist '((height . 40) (left . 0.5) (top . 0.2) (width . 160))
gc-cons-threshold (* 50 1024 1024))
@@ -5,3 +10,7 @@
(scroll-bar-mode -1)
(show-paren-mode 1)
(tool-bar-mode -1)
+
+(my/source-if-exists "dotfiles-${UNAME}/emacs/early-init")
+(my/source-if-exists "dotfiles-${DOMAIN}/emacs/early-init")
+(my/source-if-exists "dotfiles-${HOST}/emacs/early-init")