Files
emacs-dotfiles/post-init.el

57 lines
2.0 KiB
EmacsLisp

;;; post-init.el --- This file is loaded after init.el. -*- no-byte-compile: t; lexical-binding: t; -*-
;; Use straight.el for package management, integrate with use-package.
(setq straight-use-package-by-default t)
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name
"straight/repos/straight.el/bootstrap.el"
(or (bound-and-true-p straight-base-dir)
user-emacs-directory)))
(bootstrap-version 7))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(unless (memq 'use-package-autoloads features)
(straight-use-package 'use-package))
;; The compile-angel package automatically byte-compiles and
;; native-compiles Emacs Lisp libraries. It should be loaded before
;; any other package.
(use-package compile-angel
:demand t
:custom
(compile-angel-verbose nil)
:config
(compile-angel-on-load-mode)
(add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode))
;; Diminish allows us to clear up our modeline
(use-package diminish
:ensure t)
;; Since diminish was loaded after compile-angel, we cannot use the use-package
;; integration to diminish it. So, we do it manually here.
(diminish 'compile-angel-on-save-local-mode)
(diminish 'compile-angel-on-load-mode)
;; Since I did not explicitly install it, I cannot use the use-package
;; integration to deminish eldoc either. So I do it explicitly here.
(diminish 'eldoc-mode)
;; Load the configs from plug-in files.
(let ((config-dir (concat minimal-emacs-user-directory ".config.d")))
(if (not (file-exists-p config-dir))
(make-directory config-dir))
(dolist (lisp-file (directory-files config-dir t directory-files-no-dot-files-regexp))
(load lisp-file nil 'nomessage)))
;;; post-init.el ends here