Closes #40: Add function that verifies that the Emacs config has loaded.
This commit is contained in:
@@ -931,7 +931,7 @@ To prevent Emacs from saving customization information to a custom file, set `cu
|
|||||||
(add-hook 'dired-mode-hook #'dired-omit-mode)
|
(add-hook 'dired-mode-hook #'dired-omit-mode)
|
||||||
|
|
||||||
;; Enable on-the-fly spell checking (Flyspell mode).
|
;; Enable on-the-fly spell checking (Flyspell mode).
|
||||||
(add-hook text-mode-hook #'flyspell-mode)
|
(add-hook 'text-mode-hook #'flyspell-mode)
|
||||||
```
|
```
|
||||||
|
|
||||||
It is also recommended to read the following articles:
|
It is also recommended to read the following articles:
|
||||||
|
|||||||
@@ -71,18 +71,29 @@ minimalistic appearance during startup.")
|
|||||||
|
|
||||||
;;; Load pre-early-init.el
|
;;; Load pre-early-init.el
|
||||||
|
|
||||||
|
(defvar minimal-emacs--success nil)
|
||||||
|
(defvar minimal-emacs--stage "early-init.el")
|
||||||
|
(defun minimal-emacs--check-success ()
|
||||||
|
"Verify that the Emacs configuration has loaded successfully."
|
||||||
|
(unless minimal-emacs--success
|
||||||
|
(error (concat "Configuration error in: '%s'. Debug by starting Emacs "
|
||||||
|
"with: emacs --debug-init")
|
||||||
|
minimal-emacs--stage)))
|
||||||
|
(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102)
|
||||||
|
|
||||||
;; Prefer loading newer compiled files
|
;; Prefer loading newer compiled files
|
||||||
(setq load-prefer-newer t)
|
(setq load-prefer-newer t)
|
||||||
|
|
||||||
(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 ((user-init-file
|
(let ((init-file (expand-file-name filename
|
||||||
(expand-file-name filename
|
|
||||||
minimal-emacs-user-directory)))
|
minimal-emacs-user-directory)))
|
||||||
(when (file-exists-p user-init-file)
|
(when (file-exists-p init-file)
|
||||||
(load user-init-file nil t t))))
|
(setq minimal-emacs--stage init-file)
|
||||||
|
(load init-file nil t t))))
|
||||||
|
|
||||||
(minimal-emacs-load-user-init "pre-early-init.el")
|
(minimal-emacs-load-user-init "pre-early-init.el")
|
||||||
|
(setq minimal-emacs--stage "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))
|
||||||
|
|||||||
2
init.el
2
init.el
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
;;; Load pre-init.el
|
;;; Load pre-init.el
|
||||||
(minimal-emacs-load-user-init "pre-init.el")
|
(minimal-emacs-load-user-init "pre-init.el")
|
||||||
|
(setq minimal-emacs--stage "init.el")
|
||||||
|
|
||||||
;;; Before package
|
;;; Before package
|
||||||
|
|
||||||
@@ -542,6 +543,7 @@
|
|||||||
|
|
||||||
;;; Load post init
|
;;; Load post init
|
||||||
(minimal-emacs-load-user-init "post-init.el")
|
(minimal-emacs-load-user-init "post-init.el")
|
||||||
|
(setq minimal-emacs--success t)
|
||||||
|
|
||||||
(provide 'init)
|
(provide 'init)
|
||||||
;;; init.el ends here
|
;;; init.el ends here
|
||||||
|
|||||||
Reference in New Issue
Block a user