Merge pull request #41 from jamescherti/develop

Closes #40: Add function that verifies that the Emacs config has loaded.
This commit is contained in:
James Cherti
2025-03-06 12:15:07 -05:00
committed by GitHub
3 changed files with 19 additions and 6 deletions

View File

@@ -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)
;; 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:

View File

@@ -71,18 +71,29 @@ minimalistic appearance during startup.")
;;; 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
(setq load-prefer-newer t)
(defun minimal-emacs-load-user-init (filename)
"Execute a file of Lisp code named FILENAME."
(let ((user-init-file
(expand-file-name filename
minimal-emacs-user-directory)))
(when (file-exists-p user-init-file)
(load user-init-file nil t t))))
(let ((init-file (expand-file-name filename
minimal-emacs-user-directory)))
(when (file-exists-p init-file)
(setq minimal-emacs--stage init-file)
(load init-file nil t t))))
(minimal-emacs-load-user-init "pre-early-init.el")
(setq minimal-emacs--stage "early-init.el")
(setq custom-theme-directory
(expand-file-name "themes/" minimal-emacs-user-directory))

View File

@@ -16,6 +16,7 @@
;;; Load pre-init.el
(minimal-emacs-load-user-init "pre-init.el")
(setq minimal-emacs--stage "init.el")
;;; Before package
@@ -542,6 +543,7 @@
;;; Load post init
(minimal-emacs-load-user-init "post-init.el")
(setq minimal-emacs--success t)
(provide 'init)
;;; init.el ends here