summaryrefslogtreecommitdiff
path: root/emacs/early-init.el
blob: 9b1de6a90caa5ed5e16be66e47ee25c386cf47d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
;; 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))

(defun my/load-file-variations (filename)
  "Load variations of FILENAME that may exist in other dotfiles
directories."
  (dolist (elt '("${UNAME}" "${DOMAIN}" "${HOST_SHORT}" "${HOST}"))
    (my/load-file (format "dotfiles-%s/%s" elt filename))))

(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))

(setopt package-archives '(("GNU ELPA" . "https://elpa.gnu.org/packages/")
                         ("MELPA"    . "https://melpa.org/packages/"))
        package-gnupghome-dir (expand-file-name "gnupg" package-user-dir)
        package-user-dir (my/data-file-name "elpa")
        treesit-extra-load-path `(,(my/data-file-name "tree-sitter")))


;; Further Early Customization

(my/load-file-variations "emacs/early-init")