From 0ab13ec1d17cdeacb042b9c935618e9f018d81b0 Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sat, 11 Dec 2021 13:03:03 +0000 Subject: emacs: Refactor configuration --- emacs/early-init.el | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'emacs/early-init.el') diff --git a/emacs/early-init.el b/emacs/early-init.el index de5c85a..2d74a77 100644 --- a/emacs/early-init.el +++ b/emacs/early-init.el @@ -1,16 +1,32 @@ -(defun my/source-if-exists (filename) - "Load FILENAME if it exists within the dotfiles hierarchy." +;; Helper Loading Functions + +(defun my/load-file (filename) + "Load FILENAME if it exists within the dotfiles directory." (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)) +(defun my/load-file-variations (filename) + "Load variations of FILENAME that may exist in other dotfiles +directories." + (dolist (elt (mapcar (lambda (elt) (format "dotfiles-%s/%s" elt filename)) + '("${UNAME}" "${DOMAIN}" "${HOST}"))) + (my/load-file elt))) + +(my/load-file "emacs/functions") +(my/load-file-variations "emacs/functions") + + +;; Early Customization + +(setq default-frame-alist '((height . 40) (left . 0.5) + (top . 0.3) (width . 160)) gc-cons-threshold (* 50 1024 1024)) (menu-bar-mode -1) (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") + +;; Further Early Customization + +(my/load-file-variations "emacs/early-init") -- cgit v1.2.3-70-g09d2