Enhance the load function
This commit is contained in:
@@ -89,11 +89,12 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
|
|||||||
|
|
||||||
(defun minimal-emacs-load-user-init (filename)
|
(defun minimal-emacs-load-user-init (filename)
|
||||||
"Execute a file of Lisp code named 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)))
|
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
|
(setq custom-theme-directory
|
||||||
(expand-file-name "themes/" minimal-emacs-user-directory))
|
(expand-file-name "themes/" minimal-emacs-user-directory))
|
||||||
@@ -390,7 +391,7 @@ this stage of initialization."
|
|||||||
("melpa-stable" . 0)))
|
("melpa-stable" . 0)))
|
||||||
|
|
||||||
;;; Load post-early-init.el
|
;;; 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)
|
(provide 'early-init)
|
||||||
|
|
||||||
|
|||||||
4
init.el
4
init.el
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
;;; Load pre-init.el
|
;;; Load pre-init.el
|
||||||
(if (fboundp 'minimal-emacs-load-user-init)
|
(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"))
|
(error "The early-init.el file failed to loaded"))
|
||||||
|
|
||||||
;;; Before package
|
;;; Before package
|
||||||
@@ -514,7 +514,7 @@
|
|||||||
|
|
||||||
;;; Load post init
|
;;; Load post init
|
||||||
(when (fboundp 'minimal-emacs-load-user-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)
|
(setq minimal-emacs--success t)
|
||||||
|
|
||||||
(provide 'init)
|
(provide 'init)
|
||||||
|
|||||||
Reference in New Issue
Block a user