Enhance the load function

This commit is contained in:
James Cherti
2025-03-12 21:37:35 -04:00
parent b64896240a
commit a896c08de2
2 changed files with 8 additions and 7 deletions

View File

@@ -89,11 +89,12 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
(defun minimal-emacs-load-user-init (filename)
"Execute a file of Lisp code named FILENAME."
(let* ((init-file (expand-file-name filename
(let ((init-file (expand-file-name filename
minimal-emacs-user-directory)))
(load init-file :no-error :no-message)))
(when (file-exists-p init-file)
(load init-file nil :no-message))))
(minimal-emacs-load-user-init "pre-early-init")
(minimal-emacs-load-user-init "pre-early-init.el")
(setq custom-theme-directory
(expand-file-name "themes/" minimal-emacs-user-directory))
@@ -390,7 +391,7 @@ this stage of initialization."
("melpa-stable" . 0)))
;;; Load post-early-init.el
(minimal-emacs-load-user-init "post-early-init")
(minimal-emacs-load-user-init "post-early-init.el")
(provide 'early-init)

View File

@@ -16,7 +16,7 @@
;;; Load pre-init.el
(if (fboundp 'minimal-emacs-load-user-init)
(minimal-emacs-load-user-init "pre-init")
(minimal-emacs-load-user-init "pre-init.el")
(error "The early-init.el file failed to loaded"))
;;; Before package
@@ -514,7 +514,7 @@
;;; Load post init
(when (fboundp 'minimal-emacs-load-user-init)
(minimal-emacs-load-user-init "post-init"))
(minimal-emacs-load-user-init "post-init.el"))
(setq minimal-emacs--success t)
(provide 'init)